Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐹 Go
Not in CISA KEV

GHSA-g9g6-qhrc-p3qc

Fix: go-gitea/gitea#38009

GHSA-g9g6-qhrc-p3qc is a CWE-284 vulnerability in code.gitea.io/gitea. O3 Security confirms whether GHSA-g9g6-qhrc-p3qc is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

Gitea: Improper authorization on OAuth sign-in callback silently re-enables administrator-disabled accounts

Also known asCVE-2026-58422GO-2026-6056
Published
Jul 21, 2026
Updated
Jul 22, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Jul 22, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Real-World Exposure

1 pkg affected
🐹code.gitea.io/gitea

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.

Description

Summary

The OAuth2 sign-in callback in Gitea 1.26.1 unconditionally re-enables a locally-disabled account whenever the user authenticates through a linked external identity provider, silently undoing any administrator-initiated Disable Account action and issuing a fresh authenticated session in the same response. Once a user has linked any external IdP, the administrator's disable toggle becomes non-binding — the user can re-enable themselves on demand by completing one OAuth callback, regaining full read and write access to their repositories, organizations, and access tokens.

Details

Improper Authorization is present on the code and state parameters of the /user/oauth2/{source-name}/callback endpoint in Gitea version 1.26.1. The handler routers/web/auth/oauth.go::handleOAuth2SignIn reads the local user's IsActive flag at lines 350-352 and, when it is false, sets opts.IsActive = optional.Some(true) before calling user_service.UpdateUser and immediately establishing a session. The active-state precondition that the request middleware routers/web/web.go::verifyAuthWithOptions enforces for every other request is therefore evaluated against the freshly-flipped row on the next request, so a site administrator's "disable user" action is silently undone the next time the user authenticates through any linked external identity provider.

The root cause is that the callback path treats the local IsActive flag as stale bookkeeping to reconcile against the external identity, rather than as an authoritative administrative override. The local-credential sign-in path correctly renders IsErrUserInactive in the same condition; only the OAuth callback path flips the flag and proceeds.

PoC

  1. As a site administrator, configure an OAuth2 authentication source via Site Administration -> Authentication Sources -> Add Authentication Source. Any external provider works (a self-hosted Keycloak, an upstream Gitea acting as OIDC, GitHub, GitLab, Microsoft, Google).
  2. Have a normal user (alice in the example) sign in through that source at least once. The callback creates the row in external_login_user linking alice's local account to the IdP identity.
  3. As the site administrator, disable alice's account: Site Administration -> User Accounts -> alice -> "Disable Account". Confirm the flag is set with the admin API.

HTTP REQUEST

GET /api/v1/admin/users/alice HTTP/1.1
Host: <HOST>
Authorization: token <ADMIN_TOKEN>
Accept: application/json

HTTP RESPONSE

HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8

{"id":2,"login":"alice","active":false,...}
  1. Have alice click "Sign in with <source-name>" on the Gitea login page and complete the OAuth dance with the IdP. The callback handler runs, observes IsActive=false, sets opts.IsActive=true, calls UpdateUser, and issues a session on the same response. Alice lands on /.
  2. Re-read the same admin API endpoint and observe that active has flipped back to true without administrator action.

HTTP REQUEST

GET /api/v1/admin/users/alice HTTP/1.1
Host: <HOST>
Authorization: token <ADMIN_TOKEN>
Accept: application/json

HTTP RESPONSE

HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8

{"id":2,"login":"alice","active":true,...}

Impact

Once a user has linked any external identity provider, the site administrator's "disable user" toggle becomes non-binding on that account: the user can re-enable themselves on demand by completing one OAuth callback, regaining full read and write access to their repositories, organizations, and tokens. In SSO-fronted Gitea deployments where the disable toggle is the documented incident-response action for compromised accounts or departed employees, this defeats the only short-term remediation available before the identity provider can revoke the underlying federated identity.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐹Gocode.gitea.io/giteaall versions1.26.4

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for code.gitea.io/gitea. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update code.gitea.io/gitea to 1.26.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-g9g6-qhrc-p3qc is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-g9g6-qhrc-p3qc is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-g9g6-qhrc-p3qc. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Summary The OAuth2 sign-in callback in Gitea 1.26.1 unconditionally re-enables a locally-disabled account whenever the user authenticates through a linked external identity provider, silently undoing any administrator-initiated `Disable Account` action and issuing a fresh authenticated session in the same response. Once a user has linked any external IdP, the administrator's disable toggle becomes non-binding — the user can re-enable themselves on demand by completing one OAuth callback, regaining full read and write access to their repositories, organizations, and access tokens. ### Det
O3 Security · Impact-Aware SCA

Is GHSA-g9g6-qhrc-p3qc in your dependencies?

O3 detects GHSA-g9g6-qhrc-p3qc across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

GHSA-g9g6-qhrc-p3qc: gitea | O3 Security