OSV 1.4.0 · github-reviewed · 修改于 2026-06-17 07:41
发布时间
2026-06-17 07:41
GitHub 审查时间
2026-06-17 07:41
NVD 发布时间
—
源文件
advisories/github-reviewed/2026/06/GHSA-8629-vc8r-5p58/GHSA-8629-vc8r-5p58.json
Two 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.
routers/api/v1/api.go line 1599:
m.Get("/user/orgs", reqToken(), tokenRequiresScopes(
auth_model.AccessTokenScopeCategoryUser,
auth_model.AccessTokenScopeCategoryOrganization,
), org.ListMyOrgs)
// Missing checkTokenPublicOnly()
Adjacent route at line 1603 has it:
m.Group("/users/{username}/orgs", func() { ... },
..., checkTokenPublicOnly())
routers/api/v1/api.go lines 253-295. Go switch executes only the first matching case. For routes with categories [User, Organization]:
curl -H "Authorization: token <PUBLIC_ONLY_TOKEN>" https://gitea.example.com/api/v1/user/orgsExpected: only public organizations returned.
Public-only scoped tokens can enumerate private organizations the token owner belongs to. Violates the token's declared scope constraints.
checkTokenPublicOnly() to /user/orgs route at line 1599Current main branch, commit 2c2d7e6 (April 3, 2026).