CVE-2026-55982: Gitea OIDC Userinfo Endpoint Returns Identity Vulnerability

MODERATE
Advisory Identifier: GHSA-mg4f-x9v4-6h2p
CWE-200
Published
Advisory Summary

CVE-2026-55982 is a MODERATE oidc userinfo endpoint returns identity vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Gitea libraries in the Go ecosystem. The issue involves oidc userinfo endpoint returns identity claims without enforcing api token scopes. Remediation is available by upgrading affected packages to version 1.27.0.

CVE-2026-55982 at a Glance

CVE Identifier CVE-2026-55982
GHSA Identifier GHSA-mg4f-x9v4-6h2p
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Gitea
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-55982

To remediate this vulnerability, upgrade all affected Gitea dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

code.gitea.io/gitea fixed: 1.27.0
Upgrade code.gitea.io/gitea to 1.27.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for code.gitea.io/gitea

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-55982, inspect your project dependencies for Gitea:

inspect dependencies for code.gitea.io/gitea

Analyze the terminal output to locate any version of Gitea in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.27.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Gitea, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The OIDC userinfo endpoint (`GET /login/oauth/userinfo`) accepts Gitea API tokens as bearer credentials but does not enforce API token scopes before returning identity claims. A personal access token scoped only to `read:misc` can successfully retrieve user information from the OIDC userinfo endpoint, even though the same token is denied access to user-related REST API endpoints that enforce scope checks. As a result, identity information remains accessible through the OIDC endpoint regardless of the scopes assigned to the API token. ### Details Gitea supports scoped personal access tokens and enforces scope checks on user-related REST API endpoints. For example, a token scoped only to `read:misc` is denied access to endpoints such as: | Endpoint | Required Scope | |----------|----------------| | `GET /api/v1/user` | `read:user` | | `GET /api/v1/user/emails` | `read:user` | | `GET /api/v1/user/orgs` | `read:organization` | Requests to these endpoints return: ```http 403 Forbidden ``` with a scope-related error. However, the same `read:misc` token can be supplied as a bearer credential to: ```http GET /login/oauth/userinfo Authorization: Bearer <token> ``` and receives a successful response containing identity claims. Observed claims include: - `email` - `groups` The `groups` claim contains organization and team membership information associated with the authenticated user. This behavior indicates that the OIDC userinfo endpoint accepts API tokens but does not apply scope restrictions before returning identity claims. ### PoC #### PoC Details Proof-of-concept code: https://anonymous.4open.science/r/Gitea_PoC-EC93/3_poc_oidc_userinfo_scope_bypass #### Reproduction Steps 1. Create a personal access token with only the following scope: ```text read:misc ``` 2. Verify that the token cannot access user-related REST API endpoints: ```http GET /api/v1/user GET /api/v1/user/emails GET /api/v1/user/orgs ``` Each request returns: ```http 403 Forbidden ``` 3. Send the same token to the OIDC userinfo endpoint: ```http GET /login/oauth/userinfo Authorization: Bearer <read-misc-token> ``` 4. Observe that the request succeeds and returns identity claims, for example: ```json { "email": "user@example.com", "groups": [ ... ] } ``` ### Impact Holders of narrowly scoped API tokens can obtain identity information through the OIDC userinfo endpoint regardless of the scopes assigned to the token. The issue does not provide access to repositories, issues, pull requests, administrative functionality, or data belonging to other users. Impact is limited to disclosure of identity information associated with the authenticated user. However, it weakens the authorization boundary established by API token scopes because identity claims remain accessible even when the token lacks user- or organization-related scopes.

CVE-2026-55982 Affected Gitea Versions

1 component(s)
Fixed Versions:
1.27.0
Product / Package Ecosystem Affected Versions Fixed Version
code.gitea.io/gitea
Go
< 1.27.0
1.27.0

References

Frequently Asked Questions

What is CVE-2026-55982?
CVE-2026-55982 is a security vulnerability in Gitea involving OIDC userinfo Endpoint Returns Identity Claims Without Enforcing API Token Scopes under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Gitea versions are affected?
Affected versions include releases prior to 1.27.0 across affected packages: code.gitea.io/gitea.
What version fixes CVE-2026-55982?
Upgrading to 1.27.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is code.gitea.io/gitea affected?
Yes, code.gitea.io/gitea is affected in releases prior to 1.27.0. Upgrade your dependency to 1.27.0 or later.
What CWE is associated with CVE-2026-55982?
CVE-2026-55982 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check Go dependencies for CVE-2026-55982?
Run the dependency tree command: 'inspect dependencies for code.gitea.io/gitea'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mg4f-x9v4-6h2p",
  "modified" : "2026-07-21T20:42:05Z",
  "published" : "2026-07-21T20:42:05Z",
  "aliases" : [ "CVE-2026-55982" ],
  "summary" : "Gitea: OIDC userinfo Endpoint Returns Identity Claims Without Enforcing API Token Scopes",
  "details" : "### Summary\n\nThe OIDC userinfo endpoint (`GET /login/oauth/userinfo`) accepts Gitea API tokens as bearer credentials but does not enforce API token scopes before returning identity claims.\n\nA personal access token scoped only to `read:misc` can successfully retrieve user information from the OIDC userinfo endpoint, even though the same token is denied access to user-related REST API endpoints that enforce scope checks.\n\nAs a result, identity information remains accessible through the OIDC endpoint regardless of the scopes assigned to the API token.\n\n### Details\n\nGitea supports scoped personal access tokens and enforces scope checks on user-related REST API endpoints.\n\nFor example, a token scoped only to `read:misc` is denied access to endpoints such as:\n\n| Endpoint | Required Scope |\n|----------|----------------|\n| `GET /api/v1/user` | `read:user` |\n| `GET /api/v1/user/emails` | `read:user` |\n| `GET /api/v1/user/orgs` | `read:organization` |\n\nRequests to these endpoints return:\n\n```http\n403 Forbidden\n```\n\nwith a scope-related error.\n\nHowever, the same `read:misc` token can be supplied as a bearer credential to:\n\n```http\nGET /login/oauth/userinfo\nAuthorization: Bearer <token>\n```\n\nand receives a successful response containing identity claims.\n\nObserved claims include:\n\n- `email`\n- `groups`\n\nThe `groups` claim contains organization and team membership information associated with the authenticated user.\n\nThis behavior indicates that the OIDC userinfo endpoint accepts API tokens but does not apply scope restrictions before returning identity claims.\n\n### PoC\n\n#### PoC Details\n\nProof-of-concept code: \nhttps://anonymous.4open.science/r/Gitea_PoC-EC93/3_poc_oidc_userinfo_scope_bypass\n\n#### Reproduction Steps\n\n1. Create a personal access token with only the following scope:\n\n```text\nread:misc\n```\n\n2. Verify that the token cannot access user-related REST API endpoints:\n\n```http\nGET /api/v1/user\nGET /api/v1/user/emails\nGET /api/v1/user/orgs\n```\n\nEach request returns:\n\n```http\n403 Forbidden\n```\n\n3. Send the same token to the OIDC userinfo endpoint:\n\n```http\nGET /login/oauth/userinfo\nAuthorization: Bearer <read-misc-token>\n```\n\n4. Observe that the request succeeds and returns identity claims, for example:\n\n```json\n{\n  \"email\": \"user@example.com\",\n  \"groups\": [\n    ...\n  ]\n}\n```\n\n### Impact\n\nHolders of narrowly scoped API tokens can obtain identity information through the OIDC userinfo endpoint regardless of the scopes assigned to the token.\n\nThe issue does not provide access to repositories, issues, pull requests, administrative functionality, or data belonging to other users.\n\nImpact is limited to disclosure of identity information associated with the authenticated user. However, it weakens the authorization boundary established by API token scopes because identity claims remain accessible even when the token lacks user- or organization-related scopes.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "code.gitea.io/gitea"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.27.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/security/advisories/GHSA-mg4f-x9v4-6h2p"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-gitea/gitea"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/releases/tag/v1.27.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-21T20:42:05Z",
    "nvd_published_at" : null
  }
}