CVE-2026-58431: Gitea: Public-only API token restriction is not enforced on team API routes
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.
Published Jul 21, 2026
Affected packages
gitea.dev
- Ecosystem
- Go
- Affected
- < 1.27.0
- Fixed in
- 1.27.0
- Check
go list -m gitea.dev
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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: truebut 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:
Expected 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:
Impact
A public-only token can access private team resources that should be hidden from that token.
Credited to rmb122.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-60004
Gitea: Remote Code Execution via diffpatch Git Hook Installation
critical9.8ExploitedSep 8, 2026CVE-2026-28740
Gitea: Git LFS object reuse allows non-Code access to authorize private source objects
high7.1Jul 21, 2026CVE-2026-56443
Gitea: Token public-only scope bypassed on Limited-visibility owners (Repository + Package categories) — residual after CVE-2026-25714 / PR #37118
medium4.3Jul 21, 2026CVE-2026-56657
Gitea SSH Key Parser Denial of Service
medium6.2Jul 21, 2026CVE-2026-58416
Gitea: Fork-PR Actions task can read a third private repository via the collaborative-owner branch (missing fork-PR guard)
medium6.3Jul 21, 2026CVE-2026-58417
Gitea: REST API exposes organization membership of private organizations to public
medium5.3Jul 21, 2026
