4.3medium
Public-only API token restriction is not enforced on team API routes
- Severity
- 4.3medium CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 0.27% (higher than 21% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Gitea
- Also known as
- GHSA-h56g-4qw7-2mxgGO-2026-6059
Description
Public-only API token restriction is not enforced on team API routes
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Gitea Gitea Open Source Git Server | up to 1.26.4 | CVE List |
| gitea.dev (Go) | before 1.27.0 | GitHub Advisory Database, Go Vulnerability Database |
All scores
| CISA-ADP | 4.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N |
| GitHub | 4.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
Public-only API token restriction is not enforced on team API routes
GitHub Advisory Database
Summary
Gitea's /api/v1/teams/{id} API routes do not correctly enforce the public-only access token restriction.
A public-only token is intended to limit API access to public repositories and public organizations. However, several team API routes continue to return private team repository metadata and private team activity feed entries when called with a public-only token.
Details
The /api/v1/teams/{teamid} route group uses:
orgAssignment(false, true)
This loads ctx.Org.Team, but does not load ctx.Org.Organization.
The checkTokenPublicOnly middleware checks organization visibility through ctx.Org.Organization. When ctx.Org.Organization is nil, the organization visibility check silently passes.
In addition, the team repository handlers return repositories without applying repository-level public-only filtering:
repo_model.GetTeamRepositories(...)
convert.ToRepo(...)
They do not call:
ctx.TokenCanAccessRepo(repo)
The team activity feed handler also sets:
IncludePrivate: true
but does not apply:
opts.ApplyPublicOnly(ctx.PublicOnly)
PoC
Vulnerability is verified on latest gitea release (1.26.2) and nightly build.
Frist, create a public-only organization-scoped token for a user who is a member of a team in a private org with private repositories:
Use the returned token to request team repositories:
imageExpected result: Private repositories should be hidden or rejected for a public-only token. Actual result: Private team repository metadata is returned.
The team activity feed endpoint can be tested similarly:
imageImpact
A public-only token can access private team resources that should be hidden from that token.
Go Vulnerability Database
Gitea: Public-only API token restriction is not enforced on team API routes in gitea.dev
References
| https://github.com/go-gitea/gitea/security/advisories/GHSA-h56g-4qw7-2mxg | advisory, exploit, vendor-advisory, web | |
| https://github.com/go-gitea/gitea/releases/tag/v1.27.0 | release-notes, web | |
| https://blog.gitea.com/gitea-1.27.0-is-released/ | release-notes | |
| https://github.com/go-gitea/gitea | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-58431 changed 2026-08-14 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-h56g-4qw7-2mxg changed 2026-07-27 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-6059 changed 2026-07-27 | CC-BY-4.0 |
| NVD | CVE-2026-58431 changed 2026-08-26 | Public domain |