{"id":"GHSA-cr4g-f395-h25h","revision":null,"records":[{"revision":"3256fdc797c947ef86f8fcd624616323","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-20706","aliases":[],"title":"Gitea repository archive downloads bypass token scope checks","description":"Gitea versions up to and including 1.26.1 allow repository archive downloads to bypass token scope checks on the web archive download endpoint.","state":0,"publishedAt":"2026-07-03T20:19:28.868+00:00","modifiedAt":"2026-07-06T18:34:55.061+00:00","affected":[{"ecosystem":"Vendor product","name":"Gitea Open Source Git Server","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"Gitea\",\n                    \"product\": \"Gitea Open Source Git Server\",\n                    \"versions\": [\n                        {\n                            \"version\": \"0\",\n                            \"lessThanOrEqual\": \"1.26.1\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"semver\"\n                        }\n                    ],\n                    \"defaultStatus\": \"unaffected\"\n                }"}],"metrics":[],"references":["https://github.com/go-gitea/gitea/security/advisories/GHSA-cr4g-f395-h25h","https://github.com/go-gitea/gitea/pull/37735","https://github.com/go-gitea/gitea/releases/tag/v1.26.2","https://blog.gitea.com/release-of-1.26.2/"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-20706","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-20706","identifiers":["CVE-2026-20706"]},"retained":false,"historicalAffected":[]},{"revision":"7bb11e8eef924a3aa44d771673bf6319","observedAt":"2026-10-27T06:23:27.268+00:00","statement":{"source":"nvd","id":"CVE-2026-20706","aliases":[],"title":"Gitea versions up to and including 1.26.1 allow repository archive downloads to bypass token scope checks on the web archive download endpoint.","description":"Gitea versions up to and including 1.26.1 allow repository archive downloads to bypass token scope checks on the web archive download endpoint.","state":0,"publishedAt":"2026-07-03T21:16:56.433+00:00","modifiedAt":"2026-10-25T15:10:00.147+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · 134c704f-9b21-4f2e-91b3-4a467353bcc0 · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"severity":"CRITICAL"}],"references":["https://blog.gitea.com/release-of-1.26.2/","https://github.com/go-gitea/gitea/pull/37735","https://github.com/go-gitea/gitea/releases/tag/v1.26.2","https://github.com/go-gitea/gitea/security/advisories/GHSA-cr4g-f395-h25h"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-20706","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-284"],"productCriteria":[],"sourceDates":{"published":"2026-07-03T21:16:56.433","lastModified":"2026-10-25T15:10:00.147"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-20706","identifiers":["CVE-2026-20706"]},"retained":false,"historicalAffected":[]},{"revision":"1ba41c74ff8c4826a1b79040c79bf610","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-cr4g-f395-h25h","aliases":["CVE-2026-20706","GO-2026-5334"],"title":"Gitea: Token scope bypass on web archive download endpoint","description":"## Summary\n\nPR #37698 added checkDownloadTokenScope to /raw/*, /media/*, and attachment download web endpoints. The /archive/* endpoint (repo.Download in routers/web/repo/repo.go:372) was not included in the fix. This endpoint accepts OAuth2 tokens via webAuth.AllowOAuth2 (registered at routers/web/web.go:1649-1652) but does not call checkDownloadTokenScope or CheckRepoScopedToken.\n\nA personal access token with any non-repository scope (e.g., read:issue or read:misc) can download full repository archives (zip/tar.gz) of private repositories the token owner has access to.\n\n## Impact\n\nScope escalation: tokens scoped to non-repository categories can access full repository content through the archive download endpoint. Higher impact than endpoints fixed in #37698 because /archive/* serves the entire repository.\n\n## Steps to Reproduce\n\n1. Create a personal access token with ONLY read:misc scope\n2. Access: GET /{owner}/{private-repo}/archive/main.tar.gz\n3. Archive is served (200 OK) instead of being rejected (403 Forbidden)\n\nCompare with fixed endpoints:\n- GET /{owner}/{private-repo}/raw/branch/main/README.md correctly returns 403\n\n## Root Cause\n\nDownload function in routers/web/repo/repo.go:372 does not call checkDownloadTokenScope. The outer group middleware reqUnitCodeReader checks repository permission but not token scope.\n\nThe API equivalent (/api/v1/repos/{owner}/{repo}/archive/*) IS properly scoped via tokenRequiresScopes(AccessTokenScopeCategoryRepository). The git HTTP endpoints are scoped via CheckRepoScopedToken in httpBase.\n\n## Suggested Fix\n\nAdd checkDownloadTokenScope(ctx) to Download and InitiateDownload in routers/web/repo/repo.go. The function already exists in routers/web/repo/download.go (same package).\n\n## Discovery Method\n\nVariant analysis of PR #37698 — reviewed all web routes with webAuth.AllowOAuth2 middleware.","state":0,"publishedAt":"2026-06-16T23:42:04+00:00","modifiedAt":"2026-06-25T19:56:32.2871556+00:00","affected":[{"ecosystem":"Go","name":"code.gitea.io/gitea","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.26.2"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/go-gitea/gitea/security/advisories/GHSA-cr4g-f395-h25h","https://github.com/go-gitea/gitea"],"sourceUrl":"https://github.com/advisories/GHSA-cr4g-f395-h25h","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-cr4g-f395-h25h","identifiers":["GHSA-cr4g-f395-h25h","CVE-2026-20706","GO-2026-5334"]},"retained":false,"historicalAffected":[]},{"revision":"1fe162478a964c8f82f6fcb90d792752","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2026-5334","aliases":["CVE-2026-20706","GHSA-cr4g-f395-h25h"],"title":"Gitea: Token scope bypass on web archive download endpoint in code.gitea.io/gitea","description":"Gitea: Token scope bypass on web archive download endpoint in code.gitea.io/gitea","state":0,"publishedAt":"2026-06-25T18:43:19+00:00","modifiedAt":"2026-06-25T19:45:33.236117+00:00","affected":[{"ecosystem":"Go","name":"code.gitea.io/gitea","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.26.2"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/go-gitea/gitea/security/advisories/GHSA-cr4g-f395-h25h"],"sourceUrl":"https://osv.dev/vulnerability/GO-2026-5334","license":"OSV · upstream source license applies","key":"osv:GO-2026-5334","identifiers":["GO-2026-5334","CVE-2026-20706","GHSA-cr4g-f395-h25h"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-10-27T15:46:19.1555709+00:00","complete":true,"records":1758,"lastAttemptAt":"2026-10-27T15:46:19.1555709+00:00","lastSuccessAt":"2026-10-27T15:46:19.3166108+00:00","error":null,"lastVerifiedAt":"2026-10-27T15:46:19.3166123+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-187d2b72c94ceb8c4417f1032ec3109a3a3a7b730abadb561d8cdd2a96e04d27-67d02c0690a311a3477ecb30285e6a67bc5cbcf4b551d4b6cab698393621fd1a","complete":true,"records":415206,"lastAttemptAt":"2026-10-27T15:44:18.8922484+00:00","lastSuccessAt":"2026-10-27T15:44:18.7720642+00:00","error":null,"lastVerifiedAt":"2026-10-27T15:44:18.8922484+00:00","snapshotPublishedAt":"2026-10-27T15:30:39+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-43321610382942b8ad8c85917eab1546","complete":false,"records":4735,"lastAttemptAt":"2026-10-27T15:46:50.7636286+00:00","lastSuccessAt":"2026-10-24T23:18:49.862+00:00","error":"InvalidDataException","lastVerifiedAt":"2026-10-24T23:18:49.862+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":0,"expectedIdentifiers":13489},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-10-27T15:46:19.1555709+00:00","complete":true,"records":1093,"lastAttemptAt":"2026-10-27T15:46:19.1555709+00:00","lastSuccessAt":"2026-10-27T15:46:21.5213865+00:00","error":null,"lastVerifiedAt":"2026-10-27T15:46:21.5213883+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-f81e3b22a8724ee290f14b0a1bb1aaf0","complete":false,"records":13426,"lastAttemptAt":"2026-10-27T15:46:48.5530959+00:00","lastSuccessAt":"2026-10-27T15:46:48.549+00:00","error":null,"lastVerifiedAt":"2026-10-27T15:46:48.549+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13480,"expectedIdentifiers":13489},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-209ac5c5c1876448d270401dd7be9eb8338c977bffb106204e23f2a445f8dc56","complete":true,"records":9782,"lastAttemptAt":"2026-10-27T15:46:15.6695545+00:00","lastSuccessAt":"2026-10-27T15:46:15.4210182+00:00","error":null,"lastVerifiedAt":"2026-10-27T15:46:15.6695545+00:00","snapshotPublishedAt":"2026-10-27T15:33:39+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-bad5d31e7f6a5e3d338e11d8789069b63620a403f927730769688b42f768e4f6","complete":true,"records":1965,"lastAttemptAt":"2026-10-27T15:44:19.0567932+00:00","lastSuccessAt":"2026-10-26T16:35:43.1460623+00:00","error":null,"lastVerifiedAt":"2026-10-27T15:44:19.0567932+00:00","snapshotPublishedAt":"2026-10-26T16:18:29+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-93fe8481574c33257e61d513a6f77ce9dae5c9ed681fabdfa367d09ba130127c","complete":true,"records":2997,"lastAttemptAt":"2026-10-27T15:46:19.1148938+00:00","lastSuccessAt":"2026-10-27T15:46:18.9862774+00:00","error":null,"lastVerifiedAt":"2026-10-27T15:46:19.1148938+00:00","snapshotPublishedAt":"2026-10-27T15:33:39+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-4cbf2f787207c0e5343fed347b333d6fe1c6a8461089bcb67e952c72cb90f6de","complete":true,"records":230822,"lastAttemptAt":"2026-10-27T15:46:07.9055861+00:00","lastSuccessAt":"2026-10-27T15:46:06.6649981+00:00","error":null,"lastVerifiedAt":"2026-10-27T15:46:07.9055861+00:00","snapshotPublishedAt":"2026-10-27T15:18:26+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null}]}