Skip to content
Heist/ feed
UnratedFix available

Gitea: Token public-only scope bypassed on Limited-visibility owners (Repository + Package categories) — residual after CVE-2026-25714 / PR #37118

Type: advisorySource: OSV1 source record

## Summary After [PR #37118](https://github.com/go-gitea/gitea/pull/37118) / **CVE-2026-25714** (`fix: Unify public-only token filtering in API queries and repo access checks`, merged 2026-05-18, backport `#37773` to 1.26.2 — the May 2026 unification pass for public-only token filtering, reporter Medoedus per the 1.26.2 release notes), the `public-only` PAT scope is still bypassable on **Repository** and **Package** scope categories when the owner's `Visibility = Limited` (instance-internal). The sibling `Org` / `User` / `ActivityPub` cases in the same `checkTokenPublicOnly` switch correctly reject Limited owners via `!Visibility.IsPublic()`. The Repository / Package cases use `repo.IsPrivate` or `Owner.Visibility.IsPrivate()`, both of which return `false` for `VisibleTypeLimited` — so a `public-only` PAT strictly exceeds anonymous reach on a Limited owner. Tested on `gitea/gitea:1.26.2`. The decisive marker is that PR #37118's unification IS applied in the version under test (User-category PROBE returns `403 "token scope is limited to public users"`). Despite that, the Repository-category PROBE on the same Limited owner with the same PAT returns `200` and serves content. ## Affected entry points (4 spots) | File:Line | Function | Affected surface | |---|---|---| | `routers/api/v1/api.go:292` | `checkTokenPublicOnly` Package case | API v1 packages | | `routers/api/packages/api.go:76` | `reqPackageAccess` middleware | All 24 native package registries (`/api/packages//...`) | |

Announced Source revision 1
Original source ↗

GHSA-7p4h-3gxq-x3h3

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: osv:GHSA-7p4h-3gxq-x3h3

code.gitea.io/gitea

Source reference: /affected/0/package/name

Affected versions
Not stated in this record
Fixed versions
1.27.0

Source reference: /affected/0/ranges

Prerequisites
Not stated in this record

gitea.dev

Source reference: /affected/1/package/name

Affected versions
Not stated in this record
Fixed versions
1.27.0

Source reference: /affected/1/ranges

Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "ranges": [
      {
        "type": "SEMVER",
        "events": [
          {
            "introduced": "0"
          },
          {
            "fixed": "1.27.0"
          }
        ]
      }
    ],
    "package": {
      "name": "code.gitea.io/gitea",
      "purl": "pkg:golang/code.gitea.io/gitea",
      "ecosystem": "Go"
    },
    "database_specific": {
      "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-7p4h-3gxq-x3h3/GHSA-7p4h-3gxq-x3h3.json"
    }
  },
  {
    "ranges": [
      {
        "type": "SEMVER",
        "events": [
          {
            "introduced": "0"
          },
          {
            "fixed": "1.27.0"
          }
        ]
      }
    ],
    "package": {
      "name": "gitea.dev",
      "purl": "pkg:golang/gitea.dev",
      "ecosystem": "Go"
    },
    "database_specific": {
      "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-7p4h-3gxq-x3h3/GHSA-7p4h-3gxq-x3h3.json"
    }
  }
]
Related CVEs
CVE-2026-56443

Source reference: /aliases

Publisher severity

No explicit severity was provided.

Event
#13837 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement