Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCapture victim's OAuth2 authorization code
-
DeliveryIdentify vulnerable Gitea token endpoint
-
ExploitReplay code at token exchange
-
ExecutionBypass expiry and single-use checks
-
PersistReceive access token for victim
-
ImpactAccess victim repositories and data
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Replay attack prevention
|
| Exploitation Conditions | Exploitation requires the attacker to first obtain a valid OAuth2 authorization code issued by a vulnerable Gitea (before 1.25.5) acting as an OAuth2 provider - codes could be redeemed after their intended lifetime and/or reused more than once because expiry and single-use were not enforced at token exchange. Limiting factors: the target Gitea instance must have the OAuth2 authorization-code provider in use with at least one registered client; the attacker must capture a code that would otherwise be protected in transit by TLS and bound to a registered redirect URI (obtained via header/log leakage, an open redirect, a malicious/compromised client, or interception); and the enlarged window is bounded - the code is not literally eternal in all paths but the missing checks remove the intended short expiry and one-time guarantee. This is not remote-unauthenticated-against-default-config exploitation because a captured code is a prerequisite. |
| Impact | The signals conflict and should be weighed rather than taken at face value. The vendor CVSS of 9.1 (AV:N/AC:L/PR:N/UI:N, C:H/I:H) and SSVC 'technical impact: total, automatable: yes' argue for high severity because a successful replay yields full account/token access with no privileges. However, EPSS is only 0.17% (6th percentile) and CISA SSVC exploitation status is 'none' - there is no evidence of active exploitation and no public PoC identified. Crucially, the CVSS AC:L rating understates the real precondition: an attacker must first OBTAIN a valid authorization code, which normally traverses TLS and a registered redirect URI, so capture typically requires code leakage (referer headers, logs, open redirects, a malicious/compromised client, or network interception). Once a code is captured, the missing expiry and single-use checks make redemption trivial and reliable, so this is a genuine defense-in-depth gap worth patching promptly, but it is not a mass, internet-scannable RCE. Treat as an important patch for internet-facing Gitea acting as an OAuth2/SSO identity provider, prioritized below actively-exploited KEV items. |
| Exploit ScenarioDerived | An attacker obtains a victim's OAuth2 authorization code - for example via a leaked Referer header, server or proxy logs, or a partially-compromised OAuth client - and, because Gitea does not reliably expire or invalidate the code, replays it against the token endpoint to obtain a valid access token for the victim's Gitea account, gaining read/write access to that user's repositories and data. The high technical impact and 'automatable' SSVC rating mean redemption can be scripted once a code is captured; no public exploit code is currently identified. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 22, 2026
Authentication bypass via OAuth2 authorization code replay in Gitea before 1.25.5, where the server fails to consistently enforce code expiry and single-use during the token-exchange step, letting an attacker who obtains a valid authorization code redeem it (potentially more than once, and after it should have expired) to mint access tokens for a victim's account. The source fix confirms authorization codes previously had no enforced 10-minute validity window and that double-redemption was not reliably detected. EPSS is low (0.17%, 6th percentile) and CISA SSVC lists exploitation status as none, but SSVC rates the technical impact as total and marks it automatable; no public exploit identified at time of analysis.
RemediationAI
Vendor-released patch: upgrade to Gitea 1.25.5 or later, which enforces a 10-minute authorization-code validity window and reliable single-use invalidation (fixes in https://github.com/go-gitea/gitea/pull/36797 and https://github.com/go-gitea/gitea/pull/36851; release https://github.com/go-gitea/gitea/releases/tag/v1.25.5, notes https://blog.gitea.com/release-of-1.25.5/). If you cannot upgrade immediately, reduce exposure of authorization codes: ensure all OAuth2 clients use exact-match HTTPS redirect URIs and PKCE so intercepted codes are harder to redeem, review and rotate any OAuth2 client secrets, and audit access logs/token grants for suspicious repeated code exchanges - noting these controls lower but do not eliminate replay risk. As a stronger interim measure, disable or restrict Gitea's OAuth2 provider for untrusted third-party applications until the upgrade is applied, accepting that this breaks dependent SSO/integrations. Confirm the fix by verifying the running build reports version 1.25.5+.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in go, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw lives in Gitea's built-in OAuth2 authorization-code provider (models/auth/oauth2.go and routers/web/auth/oauth2_provider.go). In the OAuth2 authorization-code grant (RFC 6749 §4.1.2), the authorization code is a short-lived, one-time bearer credential exchanged at the token endpoint for an access token. CWE-294 (Authentication Bypass by Capture-replay) is the root-cause class: Gitea did not stamp codes with an expiry (ValidUntil) and did not treat a code as consumed once used, so a captured code remained valid indefinitely and could be replayed. The patch introduces oauth2AuthorizationCodeValidity = 10 minutes, an IsExpired() check that rejects and invalidates stale codes, and changes Invalidate() to inspect the affected-row count so a second redemption returns ErrOAuth2AuthorizationCodeInvalidated (invalid_grant). The single affected CPE is cpe:2.3:a:gitea:gitea_open_source_git_server, a self-hosted Go-based Git service.
Know when Gitea gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Network vector but AC:H because the attacker must first capture a valid, TLS-protected authorization code; no privileges needed to replay it, yielding high confidentiality and integrity impact and no availability impact.
Primary rating from Vendor (Gitea).
CVSS VectorVendor: Gitea
Lifecycle Timeline
2DescriptionCVE.org
Gitea versions before 1.25.5 do not consistently enforce OAuth2 authorization code expiry and single-use behavior during token exchange.
Executive ViewAI
Gitea versions prior to 1.25.5 contain an OAuth2 authorization code validation defect that allows attackers to reuse authorization codes to mint access tokens for victim accounts without compromising credentials. This authentication bypass directly threatens any organization relying on Gitea for repository access control and poses material risk of unauthorized access to source code and development assets.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Remote code execution in Gitea (self-hosted Git service) via a code-injection flaw (CWE-94) allows attackers to run arbi
Broken access control in Gitea's Composer package registry (versions up to and including 1.26.1) lets remote attackers r
Gitea before 1.16.7 does not escape git fetch remote. Rated high severity (CVSS 7.5), this vulnerability is remotely exp
The git hook feature in Gitea 1.1.0 through 1.12.5 might allow for authenticated remote code execution in customer envir
Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in Gitea Gitea
Reverse-proxy authentication bypass in the official Gitea Docker image (versions up to and including 1.26.2) allows any
Path traversal in Gitea's Org-mode (`.org`) markup renderer allows an attacker who can get Org-mode content rendered by
Container escape in Gitea act_runner (Docker backend, through act 0.262.0) lets an authenticated user with workflow-exec
models/repo_mirror.go in Gitea before 1.7.6 and 1.8.x before 1.8-RC3 mishandles mirror repo URL settings, leading to rem
Server-side request forgery and internal repository exfiltration in Gitea before 1.27.0 lets a low-privileged authentica
Authorization bypass in Gitea versions 1.22.3 through 1.26.1 allows holders of `public-only` access tokens or OAuth gran
An issue was discovered in Gitea through 1.11.5. Rated high severity (CVSS 7.5), this vulnerability is remotely exploita
EUVD-2026-41628
GHSA-5v69-g2m3-3hq3
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB