/

CVE-2026-136190

Severity:

HIGH RISK

(8.1)

Authorization Bypass (CWE-639) in gitea-mirror SSO APIs

CVE-2026-136190

Received

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-639

Impact:

Unauthorized access to and modification of SSO provider configurations

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The /api/sso/providers handlers in RayLabsHQ gitea-mirror lack ownership checks, allowing an authenticated user to access SSO providers belonging to other users. This may expose OIDC client secrets and let users overwrite or delete providers, including changing authorization and token endpoints to attacker-controlled servers.

Affected context

The vulnerability affects gitea-mirror builds before 3.38.1 that expose the /api/sso/providers handlers. It becomes risky when authenticated users can make requests to these handlers and the application does not verify that each requested provider belongs to the acting user.

Exploit preconditions

  • Attack surface: The /api/sso/providers API handlers
  • Required access: An authenticated user account
  • Trigger point: A request to read, overwrite, or delete an SSO provider
  • Why exploitation is possible: The handlers do not enforce provider ownership, allowing access across user boundaries

Why this happens

The application performs sensitive SSO provider operations without checking whether the authenticated user is authorized to access the targeted provider. This is an authorization bypass associated with CWE-639, where access control can be circumvented by referencing an object outside the caller's permitted scope.

Potential impact

  • OIDC client secrets may be disclosed in clear text
  • SSO provider configurations may be overwritten or deleted
  • Authorization and token endpoints may be redirected to attacker-controlled servers
  • Users relying on affected SSO providers may be exposed to authentication or token-handling risks

General mitigation guidance

Defensive patterns focus on enforcing authorization for every provider operation and minimizing the sensitivity of stored credentials.

  • Apply server-side ownership or role-based checks to reads, updates, and deletions
  • Scope provider lookups to the authenticated user's authorized resources
  • Avoid returning secrets in API responses unless strictly necessary
  • Protect stored credentials and restrict access to provider-management functions by least privilege
  • Validate configuration changes and monitor sensitive SSO provider operations

How teams detect issues like this

  • Review API handlers for object lookups or mutations that do not check caller ownership or permissions
  • Use static analysis or code review rules to flag sensitive operations lacking authorization checks
  • Test that users cannot read, change, or delete providers outside their authorized scope
  • Enforce API policies requiring authorization checks on every provider operation
  • Monitor for unusual provider changes and endpoint modifications

Sources

SourceLink
github.comgithub.com/RayLabsHQ/gitea-mirror/blob/v3.38.0/src/pages/api/sso/providers.ts#L10-L31
github.comgithub.com/RayLabsHQ/gitea-mirror/blob/v3.38.0/src/pages/api/sso/providers.ts#L162-L315
github.comgithub.com/RayLabsHQ/gitea-mirror/commit/c6157cdaad67321625d315b0f2f836b982cfe335
github.comgithub.com/RayLabsHQ/gitea-mirror/releases/tag/v3.38.1
github.comgithub.com/RayLabsHQ/gitea-mirror/security/advisories/GHSA-2hpx-83vg-gm45
vulncheck.comvulncheck.com/advisories/raylabshq-gitea-mirror-before-3.38.1-authorization-bypass-via-sso-provider-api

Frequently asked

questions

An attacker needs an authenticated account and access to the affected API handlers; the described issue does not require an unauthenticated request.

The missing ownership checks may allow access to other users' SSO providers, including reading OIDC client secrets and overwriting or deleting provider configurations.

Enforce server-side authorization and ownership checks for every read or mutation, and avoid exposing secrets in API responses.

Scope resource operations to the authenticated user's permissions, add cross-user authorization tests, and review API handlers for missing object-level access controls.

Find out what's already
exploitable in your codebase.