GHSA-mg4f-x9v4-6h2p: Gitea: OIDC userinfo Endpoint Returns Identity Claims Without Enforcing API Token Scopes
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:
403 Forbidden
with a scope-related error.
However, the same read:misc token can be supplied as a bearer credential to:
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:
read:misc
2. Verify that the token cannot access user-related REST API endpoints:
GET /api/v1/user
GET /api/v1/user/emails
GET /api/v1/user/orgs
Each request returns:
403 Forbidden
3. Send the same token to the OIDC userinfo endpoint:
GET /login/oauth/userinfo
Authoriz
Details
Original advisory: https://github.com/advisories/GHSA-mg4f-x9v4-6h2p
Referenced CVEs
| CVE | CSIRTS overview | External |
|---|---|---|
| CVE-2026-55982 | coverage & exploitation status | NVD · CVE.org |
Same CVEs, other sources
How other CERTs, PSIRTs and databases cover the vulnerabilities in this advisory.
- high[NEW] [high] Gitea: Multiple vulnerabilitiescert-bund
More from GitHub Security Advisories
- mediumGHSA-jr6p-8pjj-mfx6: Capsule has an incomplete fix of CVE-2026-22872: TenantResource RawItems and Generators s…2026-07-31
- mediumGHSA-68cj-mvg9-rgm2: Capsule: CapsuleConfiguration NodeMetadata regex fields lack webhook validation, allowing…2026-07-31
- mediumGHSA-ff84-5f28-78qj: re2: Out-of-bounds heap read in `exec`/`test`/`match` via attacker-influenced `lastIndex`…2026-07-31
- mediumGHSA-6hxr-mr5r-9836: re2: Global `String.prototype.match` with an empty-matchable pattern never advances → inf…2026-07-31
- mediumGHSA-x83g-979r-f5fh: Sylius Mollie Plugin has unauthenticated IDOR that leaks order token and customer PII2026-07-31