
Proof-of-concept lab and Nuclei template for CVE-2026-117635, a Gitea public-only token scope bypass on the admin API that leaks private orgs and enables admin creation.
██╗ ██╗ ████████╗ H A P P Y H A C K I N G S P A C E
██║ ██║ ╚══██╔══╝ ──────────────────────────────────────
╚██╗ ██╔╝ ██║ Vulnerable Target - CVE threat-intel
╚████╔╝ ██║ CVE-2026-117635 ▸ VT-2026-117635
╚═══╝ ╚═╝ https://vulnerabletarget.com
| CVE | CVE-2026-117635 · GHSA-37xv-m4w7-j2fh |
| CVSS v3.1 | 8.1 HIGH — CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N |
| CWE | CWE-284 (Improper Access Control) · CWE-1259 (Improper Restriction of Security Token Assignment) |
| Affected / Fixed | Gitea <= 28.2.0 → fixed in 28.3.0 (PR #39690, backport #39853) |
| VT page | vulnerabletarget.com/VT-2026-117635 · package: vt-2026-117635 |
Gitea access tokens can carry a public-only restriction meant to limit their reach to
public resources only. Through Gitea 28.2.0 this restriction is enforced on the normal API
route groups but not on the /api/v1/admin route group. A token created with public-only +
write:admin from a site-admin account is correctly refused on GET /api/v1/orgs/{private-org}
("token scope is limited to public orgs") yet is accepted on GET /api/v1/admin/orgs, which
returns private organizations. From there the same token can enumerate every user and email, create
private orgs, mint Actions runner registration tokens, and create or promote a new site
administrator — an account that survives revocation of the original token.
This is the same defect class already fixed for /api/v1/user (CVE-2026-24791, 1.26.2) and for
org/team routes (CVE-2026-58429, 1.27.0); CVE-2026-117635 is the admin-API instance of it.
sequenceDiagram
participant A as Attacker (holds a public-only + write:admin token issued by a site admin)
participant N as /api/v1/orgs/{org} (normal route group)
participant AD as /api/v1/admin/* (admin route group)
A->>N: GET /api/v1/orgs/secretorg (token: public-only)
N-->>A: 403 {"message":"token scope is limited to public orgs"} ✅ restriction enforced
A->>AD: GET /api/v1/admin/orgs?limit=50 (same token)
Note over AD: admin group attaches NEITHER checkTokenPublicOnly() NOR rejectPublicOnly()<br/>admin.GetAllOrgs hard-codes Visible {Public, Limited, Private}
AD-->>A: 200 [{"name":"secretorg","visibility":"private", ...}] ❌ restriction ignored
A->>AD: GET /api/v1/admin/users → all accounts + emails
A->>AD: POST /api/v1/admin/users → create account
A->>AD: PATCH /api/v1/admin/users/{u} {"admin":true} → promote to SITE ADMIN (persists after token revoke)
A->>AD: mint Actions runner registration token
Scope flag is recorded, but the admin group never checks it. tokenRequiresScopes()
(routers/api/v1/api.go) sets ctx.PublicOnly on the request. Two middlewares enforce it per
route group — checkTokenPublicOnly() (narrows to the public subset; has no Admin case)
and rejectPublicOnly() (refuses outright). Through v28.2.0 the admin group was declared as:
// routers/api/v1/api.go (v28.2.0)
m.Group("/admin", func() { ... },
tokenRequiresScopes(auth_model.AccessTokenScopeCategoryAdmin),
reqToken(), reqSiteAdmin()) // <-- neither checkTokenPublicOnly() nor rejectPublicOnly()
so a public-only token passes straight through.
Handler returns private data unconditionally. admin.GetAllOrgs
(routers/api/v1/admin/org.go) hard-codes the visibility set:
Visible: []api.VisibleType{api.VisibleTypePublic, api.VisibleTypeLimited, api.VisibleTypePrivate}
so the admin listing exposes private orgs regardless of the token restriction.
The fix (v28.3.0). PR #39690 ("refactor: carry the API token on the doer") moves the token
onto the doer so scope checks use it, and adds rejectPublicOnly() to the admin group (seven new
call sites total). After the fix, public-only tokens receive 403/404 on admin routes.
Precondition: the token must be issued from a site-admin account. A non-admin token with
write:adminstill gets403fromreqSiteAdmin(). The risk is that public-only tokens are explicitly "safe to share," so they are more likely to end up in CI variables, logs, or scripts.
| Affected | Gitea <= 28.2.0 |
| Fixed | 28.3.0 (released 2026-11-01; PR #39690, backport #39853) |
| Docker pre-fix (lab) | gitea/gitea:28.2.0 → mirrored to ghcr.io/happyhackingspace/vt-2026-117635:28.2.0 |
| Docker fixed (FP test) | gitea/gitea:28.3.0 |
Gitea switched from the
1.27.xline to28.xversioning in September 2026; some write-ups reference1.27.1(the reporter's test instance) but the released vulnerable/fixed tags are28.2.0/28.3.0.
| CVE / GHSA | Routes | Fixed in |
|---|---|---|
| CVE-2026-24791 (GHSA-wrr5-99h5-gq57) | /api/v1/user | 1.26.2 |
| CVE-2026-58429 (GHSA-fq2p-5p22-8g6j) + GHSA-h56g-4qw7-2mxg | org / team routes | 1.27.0 |
| CVE-2026-117635 (GHSA-37xv-m4w7-j2fh) | /api/v1/admin/* | 28.3.0 |
Package: cves/vt-2026-117635 — standard 3-file layout (index.yaml, docker-compose.yaml, vt-2026-117635.nuclei.yaml).
Lab: docker compose up brings up the mirrored pre-fix image; an embedded seed step registers
the first user (Gitea auto-promotes it to site admin → vtadmin / VtAdmin123!), creates a private org
secretorg, mints a public-only, write:admin token, runs the differential, and writes
/proof/flag.txt. Read it with docker compose logs seed or docker compose run --rm proof-reader.
Nuclei template — authenticated differential (2 requests, req-condition):
| Step | Request | Expected (vulnerable 28.2.0) |
|---|---|---|
| Control | GET /api/v1/orgs/{{org}} with Authorization: token {{token}} | 403 + "token scope is limited" |
| Bypass | GET /api/v1/admin/orgs?limit=50 with the same token | 200 + "visibility":"private" |
Match fires only when both hold — it first proves the token really is public-only, then proves the
admin route leaked a private org. On patched 28.3.0 the bypass request returns 403 → no match
(no false positive).
# Requires a public-only write:admin token and a private org slug (authenticated by design):
nuclei -t vt-2026-117635.nuclei.yaml -u http://localhost:3000 -var token=<TOKEN> -var org=secretorg