CVE-2026-58422 is a critical-severity (CVSS 9.8) CWE-284 vulnerability in code.gitea.io/gitea. A fix is available for code.gitea.io/gitea — see the affected versions and patch details below.
Improper authorization on OAuth sign-in callback silently re-enables administrator-disabled accounts
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-58422.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2026-58422 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,386 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
code.gitea.io/giteaReal-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
- 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). - Have a normal user (
alicein the example) sign in through that source at least once. The callback creates the row inexternal_login_userlinking alice's local account to the IdP identity. - 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,...}
- 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, setsopts.IsActive=true, callsUpdateUser, and issues a session on the same response. Alice lands on/. - Re-read the same admin API endpoint and observe that
activehas flipped back totruewithout 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
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | code.gitea.io/gitea | all versions | 1.26.4go get code.gitea.io/gitea@v1.26.4 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for code.gitea.io/gitea, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
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 CVE-2026-58422 is resolved across your whole dependency graph.
Workarounds
Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.
Frequently Asked Questions
Is CVE-2026-58422 in your dependencies?
Find it across Go, including transitive dependencies.