/

CVE-2026-28744

Severity:

HIGH RISK

(8.1)

Authorization Scope Bypass (CWE-863) in Gitea Tokens

CVE-2026-28744

Deferred

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-863

Impact:

Privilege Escalation / Access Control Bypass

Severity:

HIGH RISK

(8.1)

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

Gitea up to and including version 1.26.1 contains an authorization issue where Git smart HTTP requests authenticated with bearer tokens can bypass repository token scope checks.

This can allow an attacker with a valid token to perform operations outside the intended repository scope when using the smart HTTP interface.

Affected context

The vulnerability appears in Gitea deployments that:

  • Use Git smart HTTP as a transport for repository access
  • Rely on bearer or repository tokens with scoped permissions
  • Expect token scopes to limit access to specific repositories or operations

It manifests when the authorization layer does not fully enforce or correctly map token scopes for smart HTTP Git operations.

Exploit preconditions

  • Attack surface: Git smart HTTP endpoints exposed by Gitea
  • Required access: Possession of a valid bearer or repository token, even if configured with restricted scope
  • Trigger point: Performing Git smart HTTP requests (e.g., fetch, push, or other smart protocol calls) against repositories
  • Why exploitation is possible: The authorization logic for smart HTTP requests does not correctly enforce repository-level token scope checks, allowing operations beyond the token's intended scope.

Why this happens

This issue stems from incomplete or inconsistent enforcement of authorization policies for token-scoped access, mapping to CWE-863: Incorrect Authorization.

The code path handling Git smart HTTP requests accepts bearer tokens but fails to verify that the token's declared repository scope actually covers the target repository or operation.

As a result, the system grants access based on token possession alone, without robust scope validation, breaking the intended least-privilege model.

Potential impact

  • Unauthorized access to repositories the token holder should not reach
  • Ability to read code or metadata from unintended repositories
  • Potential to push or modify content in repositories beyond the token's scope
  • Expansion of a limited-service token into broader account- or instance-level access

General mitigation guidance

Mitigation generally focuses on tightening authorization checks and reducing implicit trust in bearer tokens.

Common defensive patterns include:

  • Ensuring that every authorization decision for Git smart HTTP requests cross-checks the token's declared scope against the target repository and requested action
  • Centralizing authorization logic so that all access paths reuse the same scope validation mechanisms
  • Designing tokens with minimally necessary privileges and separating tokens for automation from those used by humans
  • Implementing defense-in-depth controls such as repository-level allowlists and explicit permissions for automation identities
  • Periodically rotating tokens and monitoring for unexpected access patterns tied to scoped tokens

How teams detect issues like this

Detection can rely on both code-centric and operational controls:

  • Static analysis or code review focusing on authorization middleware, confirming that smart HTTP handlers invoke consistent scope checks
  • Verification that all token-authenticated endpoints pass through a unified access-control layer rather than custom per-endpoint checks
  • Log analysis to identify tokens accessing repositories outside their expected scope or role
  • Policy-driven tests or security unit tests that attempt access with deliberately under-scoped tokens to confirm enforcement
  • Use of automated security testing tools that model role- and scope-based authorization rules and probe for inconsistencies

Sources

SourceLink
blog.gitea.comblog.gitea.com/release-of-1.26.2/
github.comgithub.com/go-gitea/gitea/pull/37583
github.comgithub.com/go-gitea/gitea/releases/tag/v1.26.2
github.comgithub.com/go-gitea/gitea/security/advisories/GHSA-cc8w-r4qh-3v65

Frequently asked

questions

Exploitation requires possession of a valid bearer or repository token, but once a token is obtained, an attacker may use Git smart HTTP requests to access repositories or operations beyond the token's intended scope.

Not necessarily. Any bearer token with limited scope can be abused if it is accepted by the smart HTTP path without correct scope enforcement, even if the associated account was meant to have restricted repository access.

The safest pattern is to route all token-based Git smart HTTP operations through a centralized authorization layer that strictly validates token scopes against the requested repository and action, denying any request where the scope does not explicitly match.

Prevention relies on designing and testing authorization as a first-class concern: define clear scope models, reuse shared authorization components, add regression tests for scope enforcement on every endpoint, and periodically review token usage patterns for least-privilege adherence.

Find out what's already
exploitable in your codebase.