CVE-2026-27761: Gitea repository feeds bypass API token scope enforcement

Published Jul 3, 2026
·
Updated

Summary A Gitea personal access token (PAT) restricted to a non-repository scope (e.g. read:issue) can read the commit history of any private repository the token owner can access, via the repository RSS/Atom feed endpoints. The same token is correctly denied (403) on /raw, /media, /archive, and the contents API. It leaks commit SHAs, full commit messages (which frequently contain secrets and internal context), and committer name + email.

Details Gitea enforces PAT scope on repository-content endpoints via checkDownloadTokenScope() (added in PR #37698, extended to the archive endpoint by the CVE-2026-20706 fix in 1.26.2). The RSS/Atom feed handlers were never included: they (a) opt into PAT auth via webAuth.AllowBasic, (b) serve private-repo content, but (c) never call checkDownloadTokenScope().

Affected handlers (all carry AllowBasic, none call the scope check): - RenderBranchFeedRSS/Atom - routers/web/feed/render.go (last 10 commits: SHA, title, full message, committer name + email) - ShowFileFeed - routers/web/feed/file.go (per-file commit history) - repo activity feed /{owner}/{repo}.rss / .atom - TagsListFeedRSS/Atom, ReleasesFeedRSS/Atom - routers/web/repo/release.go

Root cause: routers/web/web.go registers the feed routes with webAuth.AllowBasic so a PAT authenticates, but the unit-permission middleware only checks the user's access, not the token's scope. checkDownloadTokenScope (routers/web/repo/download.go and the archive Download in repo.go) exists to close exactly that gap and is absent from the feed handlers. Same class as the recently fixed download/archive bypasses (GHSA-cr4g-f395-h25h / CVE-2026-20706); the feeds are the surface those fixes missed.

PoC Tested on gitea/gitea:1.26.2-rootless, confirmed present at main HEAD (9608cc2, 2026-06-13). 1. User carol owns private repo carol/priv with a commit (message: "add confidential secret"). 2. Create a PAT scoped to issues only, no repository scope: curl -u carol:PASS -X POST $HOST/api/v1/users/carol/tokens -d '{"name":"t","scopes":["read:issue"]}' 3. Scope-enforcing sibling correctly denies it: curl -u carol:$TOK $HOST/carol/priv/raw/branch/main/secret.txt -> 403 4. The feed leaks private data with the same token: curl -u carol:$TOK $HOST/carol/priv/rss/branch/main -> 200, returns <description>add confidential secret ... this commit message itself is sensitive</description>

| Auth (same read:issue token) | /raw/branch/main/secret.txt | /rss/branch/main | |---|---|---| | anonymous | - | 404 (private repo hidden) | | invalid token | - | 401 | | read:issue token (no repo scope) | 403 (scope enforced) | 200 + private commit data | | full-scope token | 200 | 200 (legitimate) |

Impact PATs are routinely issued narrowly and handed to third-party bots, CI jobs, or chat integrations that are meant to have no code access. This bypass lets such a token exfiltrate private-repository commit history (messages often hold secrets, ticket refs, internal context) and committer emails for every repository the owner can read. Confidentiality only; no integrity or availability impact. Preconditions: a valid PAT of any non-repository scope owned by a user with read access to the target private repo, and feeds enabled (Other.EnableFeed, default ON).

Suggested fix: call checkDownloadTokenScope(ctx) at the start of each feed handler (mirroring download.go). Longer-term, enforce repository token scope in a single route-group middleware wherever AllowBasic / AllowOAuth2 is set on a repo-content route, so the next added endpoint cannot miss it.

Other sources

Gitea versions up to and including 1.26.2 allow repository RSS and Atom feed endpoints to bypass API access token scope checks, exposing private repository commit data to tokens without the required repository scope.

MITRE

Affected Software

2 affected componentsFixes available
Gitea Gitea<=1.26.2
go/code.gitea.io/gitea<=1.26.2
1.26.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/code.gitea.io/gitea to a version that resolves this vulnerability.

    Fixed in 1.26.3
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 1.26.2Patch CVE-2026-20706
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch GHSA-cr4g-f395-h25h
  4. Configuration

    For each repository RSS/Atom feed endpoint handler (e.g., RenderBranchFeedRSS/Atom in routers/web/feed/render.go, ShowFileFeed in routers/web/feed/file.go, TagsListFeedRSS/Atom and ReleasesFeedRSS/Atom in routers/web/repo/release.go, and repo activity feeds /{owner}/{repo}.rss and .atom), call checkDownloadTokenScope(ctx) at the start of the handler so PAT scope is enforced the same way as /raw, /media, /archive, and the contents API.

    Gitea feed handlers (routers/web/feed/render.go, routers/web/feed/file.go, routers/web/repo/release.go) Token scope enforcement = Add checkDownloadTokenScope(ctx) at start of each feed handler
  5. Compensating control

    Use PATs with repository scope for any automation that needs to access repository content feeds; avoid using PATs that are restricted to non-repository scopes (e.g., read:issue only), since repository RSS/Atom feed endpoints bypass repository token scope checks in versions up to and including 1.26.2.

Event History

Jul 3, 2026
CVE Published
via MITRE·08:19 PM
Data Sourced
via MITRE·08:19 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
DescriptionSeverityWeakness
Jul 21, 2026
Advisory Published
via GitHub·08:30 PM
Data Sourced
via GitHub·08:30 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-27761?

The severity of CVE-2026-27761 is medium, with a score of 4.3.

2

How does CVE-2026-27761 affect Gitea users?

CVE-2026-27761 allows repository RSS and Atom feed endpoints to bypass API access token scope checks, potentially exposing private repository commit data.

3

How do I fix CVE-2026-27761?

To fix CVE-2026-27761, upgrade to Gitea version 1.26.3 or later.

4

What versions of Gitea are affected by CVE-2026-27761?

Gitea versions up to and including 1.26.2 are affected by CVE-2026-27761.

5

What data is exposed due to CVE-2026-27761?

CVE-2026-27761 can expose private repository commit data to tokens that lack the necessary repository scope.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203
CVE-2026-27761 - Gitea repository feeds bypass API token scope enforcement - SecAlerts