CVE-2026-58431: Gitea incorrect authorization for public-only tokens in team API routes

CVE-2026-58431 · Severity: medium · CVSS 4.3 · Published 2026-07-21

Gitea is an open-source platform for hosting software development projects. A security flaw was found where special 'public-only' access tokens, which are supposed to only see public information, could be used to view private team data and activity. This could lead to the unauthorized exposure of private repository names and internal team activities to users who should only have restricted access.

Technologies: Gitea, gitea.dev (Go). Vendors: Gitea, Go.

Quick answers

Is CVE-2026-58431 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-58431 being exploited in the wild.
How severe is CVE-2026-58431?
Medium severity, with a CVSS score of 4.3, published 21 July 2026.
Which products and versions are affected?
Gitea < 1.27.0; gitea.dev (Go) < 1.27.0, SEMVER:introduced=0,fixed=1.27.0.
Is there a fix for CVE-2026-58431?
Yes. gitea.dev (Go): upgrade to 1.27.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-58431 attacked?
It is attacked over the network, in a hosted service.
Am I affected by CVE-2026-58431?
Check whether you run Gitea or gitea.dev (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • gitea.dev (Go): upgrade to 1.27.0 or later
    go get gitea.dev@v1.27.0

Technical details

An authorization bypass exists in Gitea's `/api/v1/teams/{id}` route group. The `checkTokenPublicOnly` middleware relies on `ctx.Org.Organization` to verify organization visibility; however, the `orgAssignment` call used in these routes fails to load this object, causing the check to silently pass. Furthermore, the team repository and activity feed handlers do not apply repository-level filtering or the `ApplyPublicOnly` option. An attacker with a 'public-only' scoped token can retrieve metadata for private repositories and view private activity feeds. This is fixed in version 1.27.0.

Affected products

  • Gitea Gitea < 1.27.0

Identifiers

  • CVE-2026-58431
  • GHSA-h56g-4qw7-2mxg
  • GO-2026-6059

Timeline

  • 2026-07-13: disclosed
  • 2026-07-21: advisory: GitHub Advisory published
  • 2026-07-21: patched: Version 1.27.0 released

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.