/

CVE-2026-56443

Severity:

CRITICAL RISK

(9.6)

Token Scope Bypass (CWE-863) in Repository and Package API

CVE-2026-56443

Deferred

Vulnerability type

Category:

Incorrect Authorization

CWE:

CWE-863

Impact:

Unauthorized access to limited-visibility repositories and packages

Severity:

CRITICAL RISK

(9.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A token authorization flaw bypasses a public-only scope restriction for owners with limited visibility in repository and package categories. Under conditions where a token is evaluated against these ownership and visibility rules, an attacker may access or perform actions beyond the token's intended permissions.

Affected context

The issue occurs in authorization logic that evaluates tokens with a public-only scope against repository and package resources owned by accounts or organizations with limited visibility. Risk depends on the affected endpoint, token type, ownership state, and whether the authorization decision incorrectly treats the public-only restriction as satisfied.

Exploit preconditions

  • Attack surface: Repository and package APIs or other resource operations governed by token scopes
  • Required access: A valid token subject to the public-only scope restriction
  • Trigger point: An authorization check involving a limited-visibility owner and a repository or package resource
  • Why exploitation is possible: Scope and visibility attributes are not consistently enforced together, allowing a token to receive permissions beyond its declared scope

Why this happens

The underlying bug is an authorization decision that fails to enforce a restrictive token scope across all relevant resource ownership and visibility states. This maps to CWE-863, Incorrect Authorization, because the system may permit an authenticated principal to access or act on a resource without verifying that the requested operation is allowed by the token's effective permissions.

Potential impact

  • An attacker may access limited-visibility repository or package metadata.
  • An attacker could retrieve resources intended to remain outside public-only scope.
  • An attacker may perform unauthorized repository or package operations if affected endpoints permit writes.
  • The issue can increase the impact of token compromise or misuse.

General mitigation guidance

Mitigation generally focuses on making authorization deny-by-default and

evaluating token scope, resource visibility, ownership, and operation type as

one policy decision.

Common defensive patterns include:

  • Enforcing public-only restrictions consistently across repository and package endpoints.
  • Centralizing authorization logic rather than duplicating scope checks in individual handlers.
  • Treating limited-visibility ownership as an explicit authorization condition.
  • Using least-privilege tokens and minimizing token lifetime and resource reach.
  • Adding regression tests for every combination of token scope, owner visibility, resource category, and operation.
  • Avoiding reliance on resource naming or endpoint classification as a substitute for policy enforcement.

How teams detect issues like this

Organizations can detect similar authorization weaknesses through:

  • Static analysis and code review focused on scope checks that omit visibility or ownership attributes.
  • Tests that compare public-only tokens with broader tokens across repository and package operations.
  • Policy tests covering limited-visibility owners, organization-owned resources, and boundary cases.
  • Audit-log monitoring for access to limited-visibility resources by tokens restricted to public data.
  • Automated authorization testing or policy-analysis tools that generate permission-matrix cases.

Sources

SourceLink
blog.gitea.comblog.gitea.com/gitea-1.27.0-is-released/
github.comgithub.com/go-gitea/gitea/releases/tag/v1.27.0
github.comgithub.com/go-gitea/gitea/security/advisories/GHSA-7p4h-3gxq-x3h3

Frequently asked

questions

It may be remotely exploitable through affected repository or package API

operations when the attacker possesses a valid token that is subject to the

public-only restriction.

Yes, exploitation generally requires an authenticated token. The critical

issue is that the token may be granted access beyond its intended scope.

Apply centralized, deny-by-default authorization that evaluates token scope,

owner visibility, resource category, and requested operation together.

Maintain a complete permission matrix and test every scope and visibility

combination, including limited-visibility owners and both repository and

package resources.

Find out what's already
exploitable in your codebase.