Skip to main content

Gitea CVE-2026-58425

MEDIUM
Information Exposure (CWE-200)
2026-07-21 https://github.com/go-gitea/gitea GHSA-vxv2-8j6r-pcpg
4.3
CVSS 3.1 · GitHub Advisory
Share

Severity by source

GitHub Advisory PRIMARY
4.3 MEDIUM
AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
vuln.today AI
4.3 MEDIUM

Requires a registered OAuth client credential (PR:L); discloses limited token metadata with no integrity or availability impact (C:L/I:N/A:N).

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

Lifecycle Timeline

3
Source Code Evidence Fetched
Jul 21, 2026 - 21:11 vuln.today
Analysis Generated
Jul 21, 2026 - 21:11 vuln.today
CVE Published
Jul 21, 2026 - 20:21 github-advisory
MEDIUM 4.3

DescriptionGitHub Advisory

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=victim

admin 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:

go
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:

  1. Authenticates the introspecting client via HTTP Basic (app.ValidateClientSecret). The local variable app at this point references the introspecting client.
  2. Loads the grant for form.Token via auth.GetOAuth2GrantByID(ctx, token.GrantID).
  3. Reassigns app to auth.GetOAuth2ApplicationByID(ctx, grant.ApplicationID) (line 162). After this point, app is the token's issuing client, not the introspecting client.
  4. Populates response from the reassigned app and 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):

go
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):

go
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. aud reveals 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:

  1. 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".
  2. 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.
  3. 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:

diff
 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

AnalysisAI

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. …

Unlock full vulnerability intelligence

  • Risk assessment & exploitation conditions
  • Attack chain visualization
  • Remediation with exact patch versions
  • Threat intelligence from 22 sources
  • Personal watchlist & email alerts

Free forever · No credit card required

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata

Access
Register attacker-controlled OAuth application
Delivery
Obtain victim OAuth token via external means (log scrape, capture, or leak)
Exploit
Authenticate to /login/oauth/introspect as attacker client
Execution
Submit victim token in POST body
Persist
Server skips audience check and returns active status, username, scope, aud
Impact
Attacker confirms token validity without consuming grant or generating audit event

Vulnerability AssessmentAI

Exploitation 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 `/user/settings/applications`; (2) the attacker must already possess a target access or refresh token issued to a different OAuth client, obtained through an independent vector such as log exposure, traffic interception, or a separate credential leak. … Additional conditions and limiting factors are described in the full assessment.
Risk Assessment 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. … Full risk analysis with EPSS, KEV, and SSVC signal comparison available after sign-in.
Exploit Scenario An attacker who has registered an OAuth application on a target Gitea instance authenticates to `/login/oauth/introspect` using their own client ID and secret, then submits a victim's access token - obtained from a log file, network capture, or browser storage leak - in the POST body. The server returns `active: true`, the token's scope, the associated username, and the `aud` claim naming the victim client, confirming the token's validity without triggering any grant-consumption event or standard audit log entry. …
Remediation Upgrade to Gitea v1.27.0, which contains the fix introduced in PR #38042 (commit c9920b7bd0f6ec1f7590f104711b09d55917f9e8). … Detailed patch versions, workarounds, and compensating controls in full report.

Threat intelligence, references, and detailed analysis are available after sign-in.

More in Docker

View all
CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2019-5736 HIGH POC
8.6 Feb 11

runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac

CVE-2023-32077 HIGH POC
7.5 Aug 24

Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2023-5815 HIGH POC
8.1 Nov 22

The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post

CVE-2014-9357 CRITICAL
10.0 Dec 16

Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build

CVE-2026-52806 CRITICAL POC
9.9 Jun 23

Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config

CVE-2026-34156 CRITICAL POC
9.9 Mar 30

Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l

CVE-2019-15752 HIGH POC
7.8 Aug 28

Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c

CVE-2025-34221 CRITICAL POC
10.0 Sep 29

Vasion Print (formerly PrinterLogic) Virtual Appliance Host prior to version 25.2.169 and Application prior to version 2

CVE-2024-23054 CRITICAL POC
9.8 Feb 05

An issue in Plone Docker Official Image 5.2.13 (5221) open-source software that could allow for remote code execution du

CVE-2025-23211 CRITICAL POC
9.9 Jan 28

Tandoor Recipes is an application for managing recipes, planning meals, and building shopping lists. Rated critical seve

Share

CVE-2026-58425 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy