CVE-2026-145259 in gitea-mirror
Summary
by MITRE • 12/04/2026
RayLabsHQ gitea-mirror before 3.57.0 contains a missing authorization vulnerability in /api/auth/sso/register that allows any authenticated user to register a domain-verified OIDC provider for another user's email domain. Attackers operating that OIDC provider can assert a victim's email to take over their account, read stored GitHub and Gitea tokens via /api/config, and modify mirror settings.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 12/04/2026
The vulnerability identified in RayLabsHQ gitea-mirror versions prior to 3.57.0 represents a critical failure in access control mechanisms within the Single Sign-On registration workflow. Specifically, the endpoint responsible for registering new OIDC providers via /api/auth/sso/register lacks proper authorization checks to verify that the authenticated user initiating the request is the legitimate owner of the email domain being configured. This architectural flaw allows any authenticated user on the instance to associate a maliciously controlled OpenID Connect provider with an arbitrary email domain, provided they can demonstrate control over that domain's DNS records or OIDC metadata endpoint. By exploiting this missing authorization check, an attacker can effectively hijack the identity verification process for other users within the organization who rely on SSO authentication using emails from that specific domain.
The operational impact of this vulnerability is severe and multifaceted, primarily centering around account takeover through credential manipulation. Once an attacker registers their own OIDC provider against a victim's email domain, they can configure the identity provider to assert the victim's primary email address during login attempts. Since gitea-mirror trusts the SSO assertion for authentication, this allows the attacker to log in as the victim without knowing their password or possessing multi-factor authentication tokens associated with native accounts. This bypasses traditional security controls that rely on secret knowledge or hardware keys, effectively granting the attacker full administrative access under the guise of a legitimate user session.
Beyond immediate account takeover, the exploitation extends into data exfiltration and configuration tampering due to insufficient scope restrictions in subsequent API interactions. Upon gaining authenticated access as the victim, an adversary can query sensitive system configurations via endpoints such as /api/config. This action exposes stored credentials including GitHub personal access tokens and Gitea API keys that may have been configured for repository mirroring operations. These secrets are highly valuable as they often provide broader access to external code repositories or CI/CD pipelines beyond the scope of the gitea-mirror instance itself, potentially leading to supply chain attacks or further lateral movement within an organization's infrastructure.
Furthermore, the attacker can modify mirror settings through authorized API calls, altering how source repositories are synchronized with target instances. This capability enables persistent backdoors where malicious code injected into upstream repositories is automatically propagated to downstream mirrors, compromising software integrity across multiple systems. The combination of identity hijacking and configuration manipulation creates a high-impact scenario that undermines the confidentiality, integrity, and availability of both the mirror service and its connected ecosystems.
From a classification perspective, this vulnerability aligns with CWE-284 Improper Access Control, as it involves unauthorized modification of security-critical settings by an actor who lacks sufficient privileges for such actions. It also maps to MITRE ATT&CK technique T1078 Valid Accounts, specifically the sub-technique involving legitimate credentials obtained through identity provider compromise or misconfiguration. The attack path resembles aspects of SAML/OIDC binding attacks where trust relationships are abused to impersonate users.
Mitigation strategies must prioritize immediate patching to version 3.57.0 or later, which addresses the authorization gap in the OIDC registration logic. In environments where upgrading is not immediately feasible, administrators should implement strict network-level restrictions on SSO configuration endpoints if possible, though this may be challenging for web applications relying on standard HTTP methods. Additionally, enforcing multi-factor authentication that does not rely solely on email-based verification can reduce the impact of account takeover attempts. Organizations should also audit existing OIDC provider registrations to ensure no unauthorized providers have been associated with sensitive domains and rotate any exposed tokens or secrets immediately upon detection of potential compromise. Regular monitoring for anomalous login patterns originating from unexpected identity providers can serve as an early warning mechanism for ongoing exploitation attempts.