{"id":"CVE-2026-25714","aliases":["CVE-2026-25714","GHSA-8629-vc8r-5p58","GO-2026-5243"],"related":[],"kind":"vulnerability","state":"published","title":"Gitea user organization API bypasses public-only token filtering","summary":"Gitea versions up to and including 1.26.1 do not apply public-only token filtering consistently to the user organization API, leaving an incomplete fix for CVE-2025-68941.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Gitea versions up to and including 1.26.1 do not apply public-only token filtering consistently to the user organization API, leaving an incomplete fix for CVE-2025-68941.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nTwo related issues in the token public-only scope enforcement introduced by PR #32204 (CVE-2025-68941 fix). A public-only scoped API token can access private organization data.\n\n## Issue 1: /user/orgs missing checkTokenPublicOnly()\n\n`routers/api/v1/api.go` line 1599:\n```go\nm.Get(\"/user/orgs\", reqToken(), tokenRequiresScopes(\n    auth_model.AccessTokenScopeCategoryUser,\n    auth_model.AccessTokenScopeCategoryOrganization,\n), org.ListMyOrgs)\n// Missing checkTokenPublicOnly()\n```\n\nAdjacent route at line 1603 has it:\n```go\nm.Group(\"/users/{username}/orgs\", func() { ... },\n    ..., checkTokenPublicOnly())\n```\n\n## Issue 2: checkTokenPublicOnly switch-case evaluates only first matching category\n\n`routers/api/v1/api.go` lines 253-295. Go switch executes only the first matching case. For routes with categories [User, Organization]:\n\n1. Organization case matches first (line 263)\n2. ctx.Org.Organization is nil on user routes, passes\n3. ctx.ContextUser.IsOrganization() is false, passes\n4. User case (line 273) is never reached\n5. User visibility check skipped entirely\n\n## Steps to Reproduce\n\n1. Create a token with public-only scope (Settings > Applications > check \"public only\")\n2. Call: `curl -H \"Authorization: token <PUBLIC_ONLY_TOKEN>\" https://gitea.example.com/api/v1/user/orgs`\n3. Response includes private and limited-visibility organizations\n\nExpected: only public organizations returned.\n\n## Impact\n\nPublic-only scoped tokens can enumerate private organizations the token owner belongs to. Violates the token's declared scope constraints.\n\n## Suggested Fix\n\n1. Add `checkTokenPublicOnly()` to `/user/orgs` route at line 1599\n2. Replace switch with loop over all categories so User visibility check is not skipped\n\n## Version\n\nCurrent main branch, commit 2c2d7e6 (April 3, 2026).","format":"markdown","source":"ghsa"},{"lang":"en","text":"Gitea: Incomplete CVE-2025-68941 fix: /user/orgs missing checkTokenPublicOnly + switch-case logic flaw in code.gitea.io/gitea","format":"markdown","source":"go"},{"lang":"es","text":"Las versiones de Gitea hasta la 1.26.1 inclusive no aplican el filtrado de tokens solo públicos de manera consistente a la API de organización de usuario, dejando una solución incompleta para CVE-2025-68941.","source":"nvd"}],"published":"2026-06-16T23:41:31.000Z","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-862"],"affected":[{"ranges":[{"type":"semver","introduced":"0","lastAffected":"1.26.1","status":"affected"}],"vendor":"Gitea","product":"Gitea Open Source Git Server","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.26.2"}],"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.2"}],"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-8629-vc8r-5p58","tags":["advisory","exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/go-gitea/gitea/pull/37118","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://github.com/go-gitea/gitea/releases/tag/v1.26.2","tags":["release-notes"],"sources":["cvelist","nvd"]},{"url":"https://blog.gitea.com/release-of-1.26.2/","tags":["release-notes"],"sources":["cvelist","nvd"]},{"url":"https://github.com/go-gitea/gitea","tags":["package"],"sources":["ghsa"]}],"credits":["Medoedus"],"assigner":"Gitea","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-07-07T15:33:18.306Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-25714","url":"https://www.cve.org/CVERecord?id=CVE-2026-25714","licence":"CVE Terms of Use","modified":"2026-07-07T16:59:52.655Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8629-vc8r-5p58","url":"https://github.com/advisories/GHSA-8629-vc8r-5p58","licence":"CC-BY-4.0","modified":"2026-06-25T19:56:08.061Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5243","url":"https://pkg.go.dev/vuln/GO-2026-5243","licence":"CC-BY-4.0","modified":"2026-06-25T19:45:20.602Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-25714","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25714","licence":"Public domain","modified":"2026-10-25T15:10:00.147Z"}],"updatedAt":"2026-11-25T22:59:27.110Z","epss":{"score":0.00393,"percentile":0.35539,"date":"2026-12-01T12:00:22.000Z"}}