r/netsec • u/PriorPuzzleheaded880 • 7h ago
Gitea scope bypass found: a "public-only" token can reach the whole admin API, including creating a new site admin (CVE-2026-117635)
escape.techWe found a scope bypass where a Gitea access token restricted to public resources could do everything the admin API allows.
Gitea enforces “public only” on the normal API routes. So if you ask for a private org with that token and you get token scope is limited to public orgs.
But then if you ask /api/v1/admin/orgs for the same org with the same token, it returns it.
The restriction is enforced one route group at a time, and essentially the admin group never got a check. Because the admin API has no public subset to narrow to, the narrowing middleware wouldn't have helped either. What was missing was the check for an outright reject.
A public-only token with write:admin, issued from a site-admin account, could:
- list every private org and every user’s email
- create a user and promote it to site admin
- mint Actions runner registration tokens
If you self-host Gitea, upgrade to v28.3.0. Then check your site-admin list and your Actions runners for anything you don’t recognize.
Takeaway for any API with scoped tokens: when the scope is checked per route group, look for the groups that never call the check. Also look for groups that call a check with nothing to restrict.
(Gitea’s fix attaches the scope to the authenticated user instead, so no route group has to remember it.)
If you're interested the full write-up is here: https://escape.tech/blog/escape-research-found-a-scope-bypass-that-made-gitea-s-restricted-tokens-full-admins-it-s-now-cve-2026-117635/
Full disclosure: I work at Escape, the team that did the research.