Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessRegister attacker-controlled OAuth application
-
DeliveryObtain victim OAuth token via external means (log scrape, capture, or leak)
-
ExploitAuthenticate to /login/oauth/introspect as attacker client
-
ExecutionSubmit victim token in POST body
-
PersistServer skips audience check and returns active status, username, scope, aud
-
ImpactAttacker confirms token validity without consuming grant or generating audit event
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V14 - Data Protection Data exposure prevention
MITRE ATT&CK
2 techniques across 2 tactics: Collection, Discovery The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires two prerequisites: (1) the attacker must hold valid credentials (client ID and secret) for any registered OAuth application on the target Gitea instance - on default configurations with open user registration, any authenticated user can create one via |
| Impact | The NVD-assigned CVSS 3.1 score of 4.3 (AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N) is consistent with the actual impact: low-privilege network exploitation with limited confidentiality impact and no integrity or availability consequence. The vulnerability is not listed in CISA KEV, indicating no confirmed widespread active exploitation at time of analysis. However, a fully functional PoC ( |
| Exploit ScenarioDerived | An attacker who has registered an OAuth application on a target Gitea instance authenticates to |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 21, 2026
OAuth token introspection in Gitea prior to v1.27.0 discloses token metadata - including active status, scope, username, and JWT registered claims - to any authenticated OAuth client regardless of whether that client is the token's intended audience, violating RFC 7662 section 4. Any registered OAuth application on the target instance can call /login/oauth/introspect with a token issued to a completely different client and receive a valid response. No public exploit is confirmed in CISA KEV, but a complete proof-of-concept reproduction script (poc.sh) is publicly attached to the GHSA advisory, making exploitation trivially reproducible by anyone with a registered OAuth client credential.
RemediationAI
Upgrade to Gitea v1.27.0, which contains the fix introduced in PR #38042 (commit c9920b7bd0f6ec1f7590f104711b09d55917f9e8). The patch preserves a reference to the introspecting client's application record (introspectingApp) separately from the token's issuing application and adds the guard if grant == nil || grant.ApplicationID != introspectingApp.ID before populating the response, causing the endpoint to return an RFC 7662-compliant inactive response rather than disclosing token metadata to non-audience clients. The release is available at https://github.com/go-gitea/gitea/releases/tag/v1.27.0. If immediate upgrade is not feasible, restrict network access to the /login/oauth/introspect endpoint at the reverse-proxy layer to trusted internal client IPs only - this eliminates external exposure but does not protect against compromise by internal clients. Additionally, disabling OAuth application self-registration for non-admin users (via Gitea site administration settings) raises the credential bar for unauthenticated external actors, since the attack requires a registered client ID and secret.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 3 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 root cause is a variable-shadowing logic error in routers/web/auth/oauth2_provider.go within the IntrospectOAuth handler (lines 130-175). The handler correctly authenticates the calling client via HTTP Basic auth and stores its application record in a local app variable; however, when resolving the submitted token's grant via auth.GetOAuth2GrantByID, the code immediately reassigns the same app variable to the token's issuing application (auth.GetOAuth2ApplicationByID(ctx, grant.ApplicationID)), permanently overwriting the reference to the introspecting client. The handler never compares the introspecting client's ID against grant.ApplicationID, so any syntactically valid, cryptographically sound JWT is returned in full to any authenticated requester. The parallel fix (PR #37704, commit 7e54514316, 2026-05-15) applied an if grant.ApplicationID != app.ID guard to both handleRefreshToken and handleAuthorizationCode in the same file but did not extend to IntrospectOAuth. CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor) is the applicable root cause class. The affected package is code.gitea.io/gitea (CPE: pkg:go/code.gitea.io_gitea).
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:L/UI:N/S:U/C:L/I:N/A:N
Requires a registered OAuth client credential (PR:L); discloses limited token metadata with no integrity or availability impact (C:L/I:N/A:N).
Primary rating from Vendor (https://github.com/go-gitea/gitea).
CVSS VectorVendor: https://github.com/go-gitea/gitea
DescriptionCVE.org
Live reproduction against Gitea 1.26.1
Setup: Gitea 1.26.1 docker stack with two users (admin and victim) and two OAuth applications owned by different users:
Client A: id=5dda747d-7fdd-4694-85ff-ce4f893ce51e owner=admin
Client B: id=588f778f-4a41-4914-ae01-85d776c369db owner=victimadmin runs an OAuth flow against Client A and obtains an access token. victim (acting through Client B's credentials) calls the introspection endpoint with Client A's access token in the body:
$ curl -s -u "$B_ID:$B_SEC" -X POST http://localhost:3001/login/oauth/introspect \
--data-urlencode "token=$CLIENT_A_ACCESS_TOKEN"
{
"active": true,
"username": "admin",
"iss": "http://localhost:3001",
"sub": "1",
"aud": [
"5dda747d-7fdd-4694-85ff-ce4f893ce51e"
]
}Note the aud claim: the server explicitly states the token's audience is Client A, yet returns the full metadata to Client B. Per RFC 7662 section 4 ("The authorization server SHOULD also limit the information it discloses about each token to the resources that are authorized to receive it") the introspection result must not be disclosed to clients other than the token's audience.
Full reproduction script attached as poc.sh. Full session log attached as live_run.log.
Root cause
routers/web/auth/oauth2_provider.go:130-175 IntrospectOAuth:
func IntrospectOAuth(ctx *context.Context) {
clientIDValid := false
authHeader := ctx.Req.Header.Get("Authorization")
if parsed, ok := httpauth.ParseAuthorizationHeader(authHeader); ok && parsed.BasicAuth != nil {
clientID, clientSecret := parsed.BasicAuth.Username, parsed.BasicAuth.Password
app, err := auth.GetOAuth2ApplicationByClientID(ctx, clientID)
if err != nil && !auth.IsErrOauthClientIDInvalid(err) {
log.Error("Error retrieving client_id: %v", err)
ctx.HTTPError(http.StatusInternalServerError)
return
}
clientIDValid = err == nil && app.ValidateClientSecret([]byte(clientSecret))
}
if !clientIDValid {
ctx.Resp.Header().Set("WWW-Authenticate", `Basic realm="Gitea OAuth2"`)
ctx.PlainText(http.StatusUnauthorized, "no valid authorization")
return
}
var response struct {
Active bool `json:"active"`
Scope string `json:"scope,omitempty"`
Username string `json:"username,omitempty"`
jwt.RegisteredClaims
}
form := web.GetForm(ctx).(*forms.IntrospectTokenForm)
token, err := oauth2_provider.ParseToken(form.Token, oauth2_provider.DefaultSigningKey)
if err == nil {
grant, err := auth.GetOAuth2GrantByID(ctx, token.GrantID)
if err == nil && grant != nil {
app, err := auth.GetOAuth2ApplicationByID(ctx, grant.ApplicationID) // shadows the introspecting client's `app`
if err == nil && app != nil {
response.Active = true
response.Scope = grant.Scope
response.RegisteredClaims = oauth2_provider.NewJwtRegisteredClaimsFromUser(app.ClientID, grant.UserID, nil)
}
if user, err := user_model.GetUserByID(ctx, grant.UserID); err == nil {
response.Username = user.Name
}
}
}
ctx.JSON(http.StatusOK, response)
}The handler:
- Authenticates the introspecting client via HTTP Basic (
app.ValidateClientSecret). The local variableappat this point references the introspecting client. - Loads the grant for
form.Tokenviaauth.GetOAuth2GrantByID(ctx, token.GrantID). - Reassigns
apptoauth.GetOAuth2ApplicationByID(ctx, grant.ApplicationID)(line 162). After this point,appis the token's issuing client, not the introspecting client. - Populates
responsefrom the reassignedappand the grant.
There is no comparison between the introspecting client's id and grant.ApplicationID. The endpoint will return metadata for any token whose JWT signature validates, regardless of which client is asking.
Patch parity with PR #37704
The same file contains two recently-hardened handlers in commit 7e54514316 ("fix(oauth): bind token exchanges to the original client request", PR #37704, 2026-05-15) that added exactly this missing check:
handleRefreshToken (routers/web/auth/oauth2_provider.go:561-568):
if grant.ApplicationID != app.ID {
handleAccessTokenError(ctx, oauth2_provider.AccessTokenError{
ErrorCode: oauth2_provider.AccessTokenErrorCodeInvalidGrant,
ErrorDescription: "refresh token belongs to a different client",
})
return
}handleAuthorizationCode (routers/web/auth/oauth2_provider.go:640-647):
if authorizationCode.RedirectURI != "" && form.RedirectURI != authorizationCode.RedirectURI {
handleAccessTokenError(ctx, oauth2_provider.AccessTokenError{ ... })
return
}
// later in the same function:
if authorizationCode.Grant.ApplicationID != app.ID {
handleAccessTokenError(ctx, ...)
return
}IntrospectOAuth shares the same problem space (it consumes a token bound to a grant whose application may differ from the requesting client) but did not receive the parallel patch.
Impact
Any authenticated OAuth client can call /login/oauth/introspect with another client's access or refresh token in the body and learn:
active(true or false). A token-validity oracle that survives across application boundaries without consuming or "using" the token.scope. The scope of the token.username. The user the token belongs to.iss,sub,aud. Standard JWT registered claims.audreveals the issuing client_id, making it obvious to the introspecting client that the token does not belong to them. The server returns the data anyway.
Practical scenarios:
- Stolen-token validation oracle. An attacker who exfiltrates an access token from logs, traffic capture, browser memory, or a leaked dump can verify the token is still active before using it for higher-noise actions like API calls. The probe does not consume the grant counter, so it does not appear in audit trails of "actual token use".
- Cross-tenant metadata enumeration. Any user can register their own OAuth application on a Gitea instance (web UI: /user/settings/applications). The attacker uses their own valid credentials to introspect tokens belonging to other tenants' clients. They learn which user/scope each token corresponds to without ever using it.
- Token-confusion reconnaissance. Before chaining a separate vulnerability (e.g., a future token-replay or session-fixation bug), the attacker can use introspection to map the token universe.
Suggested remediation
A one-line fix matching the PR #37704 pattern:
grant, err := auth.GetOAuth2GrantByID(ctx, token.GrantID)
if err == nil && grant != nil {
+ if grant.ApplicationID != app.ID {
+ // do not reveal token metadata for tokens not issued to this client
+ ctx.JSON(http.StatusOK, response) // response is zero-valued, active=false
+ return
+ }
app, err := auth.GetOAuth2ApplicationByID(ctx, grant.ApplicationID)Or, equivalently, replace the inner app reassignment with a check that uses the introspecting client's app.ClientID directly for the response claims.
Affected versions
Confirmed at Gitea v1.26.1 (latest release, 2026-04-24, docker image gitea/gitea:1.26.1). The vulnerable code path has been in place since the introspection endpoint was introduced; the recent PR #37704 / #37706 OAuth hardening landed in master May 15-16 2026 but did not touch this endpoint.
Attachments
- poc.sh: Full reproduction script.
- live_run.log: Full session log.
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
Authenticated command injection in Dokploy (self-hostable PaaS) versions 0.29.3 through 0.29.12 lets a low-privileged us
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
Same weakness CWE-200 – Information Exposure
View allSame technique Information Disclosure
View allVendor StatusVendor
SUSE
Severity: Moderate| Product | Status |
|---|---|
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
EUVD-2026-58154
GHSA-vxv2-8j6r-pcpg
NVD
CVE.org
EPSS
Exploit-DB