Summary
CVE-2026-20706 is a token scope authorization bypass vulnerability (CWE-863: Incorrect Authorization) affecting Gitea, the open-source self-hosted Git server, in all versions up to and including 1.26.1. Due to an incomplete implementation of download token scope enforcement, the web archive download endpoint (/archive/*) was left unguarded, allowing access tokens with insufficient repository scopes to download full private repository archives. With a CVSS v3.1 base score of 9.1 (Critical) assigned by NVD, this vulnerability poses a severe risk to organizations hosting proprietary source code on publicly reachable Gitea instances.
Technical details
- Root cause: Pull request #37698 added
checkDownloadTokenScopeenforcement to the/raw/*,/media/*, and attachment download endpoints inrouters/web/repo/download.go, but the/archive/*endpoint — specificallyrepo.Downloadandrepo.InitiateDownloadinrouters/web/repo/repo.go(line 372) — was omitted from this fix. ThecheckDownloadTokenScopefunction already existed in the same package but was simply never called for the archive route. - Trigger condition: Any request to the web archive download endpoint (
/archive/*) using a token whose scope does not grant repository access (e.g.,read:issue) will bypass the scope check and succeed, returning the full repository archive. - Attack vector: Network-accessible; exploitable against any Gitea instance reachable over HTTP/HTTPS. The vulnerability was discovered through variant analysis of PR #37698 by reviewing all web routes decorated with the
webAuth.AllowOAuth2middleware. - Impact: Unauthorized disclosure of full repository archives, including private source code. Confidentiality is directly compromised; repositories containing proprietary software, credentials, configuration data, or intellectual property are at risk of unauthorized exfiltration.
- No public proof-of-concept has been identified for this specific CVE; however, exploitation requires only knowledge of the advisory and the ability to craft a web request to the unguarded
/archive/*endpoint.
Affected software
- Gitea Open Source Git Server, all versions up to and including 1.26.1
- The API archive endpoint is separately scope-checked and is not affected; the bypass is specific to the web archive download path.
Severity
- CVSS v3.1 Base Score: 9.1 (Critical)
- CVSS v3.1 Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N - CWE: CWE-863 – Incorrect Authorization
Mitigation and recommended actions
- Immediate action: Upgrade to Gitea 1.26.2 or later, which contains the fix introduced in commit "CVE-2026-20706: fix: Add missed token scope checking (#37735)". Gitea has since also released versions 1.26.3 and 1.26.4, which address additional security issues; upgrading to the latest stable release is strongly recommended.
- If immediate patching is not possible: Restrict network-level access to the Gitea instance so that the web archive download endpoint (
/<user>/<repo>/archive/*) is not reachable from untrusted networks or the public internet. Rotate any access tokens that may have been used to access repositories outside their intended scope.
IONIX Status
The IONIX research team is tracking ongoing exploitation attempts and recommends immediate patching. Potentially affected assets are outlined in this post.

