{"id":"CVE-2026-27761","aliases":["CVE-2026-27761","GHSA-3pww-vcvm-3gmj","GO-2026-6031"],"related":[],"kind":"vulnerability","state":"published","title":"Gitea repository feeds bypass API token scope enforcement","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nA 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.\n\n### Details\nGitea 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()`.\n\nAffected handlers (all carry `AllowBasic`, none call the scope check):\n- `RenderBranchFeedRSS/Atom` - `routers/web/feed/render.go` (last 10 commits: SHA, title, full message, committer name + email)\n- `ShowFileFeed` - `routers/web/feed/file.go` (per-file commit history)\n- repo activity feed `/{owner}/{repo}.rss` / `.atom`\n- `TagsListFeedRSS/Atom`, `ReleasesFeedRSS/Atom` - `routers/web/repo/release.go`\n\nRoot 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.\n\n### PoC\nTested on `gitea/gitea:1.26.2-rootless`, confirmed present at `main` HEAD (9608cc2, 2026-06-13).\n1. User `carol` owns private repo `carol/priv` with a commit (message: \"add confidential secret\").\n2. Create a PAT scoped to issues only, no repository scope:\n   `curl -u carol:PASS -X POST $HOST/api/v1/users/carol/tokens -d '{\"name\":\"t\",\"scopes\":[\"read:issue\"]}'`\n3. Scope-enforcing sibling correctly denies it:\n   `curl -u carol:$TOK $HOST/carol/priv/raw/branch/main/secret.txt`  ->  403\n4. The feed leaks private data with the same token:\n   `curl -u carol:$TOK $HOST/carol/priv/rss/branch/main`  ->  200, returns\n   `<description>add confidential secret ... this commit message itself is sensitive</description>`\n\n| Auth (same read:issue token) | /raw/branch/main/secret.txt | /rss/branch/main |\n|---|---|---|\n| anonymous | - | 404 (private repo hidden) |\n| invalid token | - | 401 |\n| read:issue token (no repo scope) | 403 (scope enforced) | 200 + private commit data |\n| full-scope token | 200 | 200 (legitimate) |\n\n### Impact\nPATs 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).\n\nSuggested 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Gitea: API access token scope enforcement bypass on repository RSS/Atom feed endpoints leaks private repository commit data in code.gitea.io/gitea","format":"markdown","source":"go"},{"lang":"es","text":"Las versiones de Gitea hasta la 1.26.2 inclusive permiten que los puntos finales de los feeds RSS y Atom del repositorio omitan las comprobaciones de alcance de los tokens de acceso de la API, exponiendo datos de commits de repositorios privados a tokens sin el alcance de repositorio requerido.","source":"nvd"}],"published":"2026-07-03T20:19:36.576Z","modified":"2026-10-25T15:10:00.147Z","severity":{"scorer":"Gitea","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"},"severities":[{"scorer":"Gitea","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-863"],"affected":[{"ranges":[{"type":"semver","introduced":"0","lastAffected":"1.26.2","status":"affected"}],"vendor":"Gitea","product":"Gitea Open Source Git Server","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.26.3"}],"ecosystem":"Go","package":"code.gitea.io/gitea","purl":"pkg:golang/code.gitea.io/gitea","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.26.3"}],"ecosystem":"Go","package":"code.gitea.io/gitea","purl":"pkg:golang/code.gitea.io/gitea","source":"go"}],"references":[{"url":"https://github.com/go-gitea/gitea/security/advisories/GHSA-3pww-vcvm-3gmj","tags":["advisory","exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/go-gitea/gitea/pull/38147","tags":["patch","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/go-gitea/gitea/releases/tag/v1.26.3","tags":["release-notes","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://blog.gitea.com/release-of-1.26.3-and-1.26.4/","tags":["release-notes"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27761","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/go-gitea/gitea/commit/9e84deb969aff5c1115c2984e41250f28c78451f","tags":["web"],"sources":["ghsa","go"]},{"url":"https://blog.gitea.com/release-of-1.26.3-and-1.26.4","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/go-gitea/gitea","tags":["package"],"sources":["ghsa"]}],"credits":["babakizo420"],"assigner":"Gitea","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-07-07T14:36:41.805Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-27761","url":"https://www.cve.org/CVERecord?id=CVE-2026-27761","licence":"CVE Terms of Use","modified":"2026-07-07T16:58:51.949Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3pww-vcvm-3gmj","url":"https://github.com/advisories/GHSA-3pww-vcvm-3gmj","licence":"CC-BY-4.0","modified":"2026-07-22T21:11:24.518Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6031","url":"https://pkg.go.dev/vuln/GO-2026-6031","licence":"CC-BY-4.0","modified":"2026-07-22T21:00:31.513Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-27761","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27761","licence":"Public domain","modified":"2026-10-25T15:10:00.147Z"}],"updatedAt":"2026-11-25T22:59:27.114Z","epss":{"score":0.00519,"percentile":0.45585,"date":"2026-12-01T12:00:22.000Z"}}