Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Gitea: Privilege Escalation via Access Token Scope Escalation in API (CVE-2026-56654)

0
High
Published: 07/21/2026 (07/21/2026, 20:24:25 UTC)
Source: GCVE Database
Product: code.gitea.io/gitea

Description

Gitea versions prior to 1.27.0 contain a vulnerability in the API endpoint for creating Personal Access Tokens that allows privilege escalation. The API's authentication middleware incorrectly treats tokens passed in a Basic auth format as password-based authentication, bypassing intended restrictions. This flaw enables an attacker with a limited-scope token to create a new token with full privileges without knowing the account password.

CVSS v4.0

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Affected software

Goghsa
code.gitea.io/gitea
Affected versions
<1.27.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/22/2026, 00:51:45 UTC

Technical Analysis

The vulnerability arises because the Gitea API endpoint POST /users/{username}/tokens uses a middleware intended to require password-based authentication to create new Personal Access Tokens (PATs). However, when a token is supplied in the Authorization header as Basic auth with the format 'Basic base64(<token>:x-oauth-basic)', the Basic auth handler validates the token and sets the authentication method to 'basic', causing the middleware to incorrectly allow the request. The token creation handler then creates a new token with any requested scope without verifying that the requested scope is a subset of the caller's token scope. Consequently, an attacker possessing a token with restricted scope (e.g., write:user) can escalate privileges by creating a new token with full 'all' scope, gaining complete account access.

Potential Impact

An attacker with a restricted Personal Access Token can bypass authentication checks and create a new token with full privileges. This leads to full account compromise without needing the account password. The vulnerability allows scope escalation of API tokens, undermining the security model of token-based authentication in Gitea.

Mitigation Recommendations

A fix is available in Gitea version 1.27.0 and later. Users should upgrade to version 1.27.0 or newer to remediate this vulnerability. Until patched, avoid using tokens in Basic auth format for API requests that create new tokens, and restrict token scopes and usage carefully. Patch status is confirmed by the absence of affected versions from 1.27.0 onwards.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-683j-3ff6-hh2x
Osv Schema Version
1.4.0
Aliases
["CVE-2026-56654"]
Ecosystems
["Go"]
Database Specific Severity
HIGH
Cvss Version
4.0

Threat ID: 6a600abb9c2644c7f8fe2b72

Added to database: 07/22/2026, 00:11:39 UTC

Last enriched: 07/22/2026, 00:51:45 UTC

Last updated: 07/31/2026, 12:28:12 UTC

Views: 52

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses