/

CVE-2026-24791

Severity:

HIGH RISK

(8.1)

Authorization Bypass (CWE-863) in /api/v1/user Routes

CVE-2026-24791

Deferred

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-863

Impact:

Unauthorized Access to Private Resources

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

A broken authorization vulnerability in the /api/v1/user self-service routes allows public-only tokens to bypass restrictions intended to protect private resources. An attacker possessing such a token may access private user-related data or operations when the endpoint relies on token type without enforcing resource visibility.

Affected context

The issue occurs in deployments exposing the /api/v1/user self routes where public-only tokens are accepted. It becomes risky when authorization checks distinguish token authentication from the permissions required to access private resources, allowing a token with limited public scope to reach data or actions outside that scope.

Exploit preconditions

  • Attack surface: The /api/v1/user self-service API routes
  • Required access: A valid public-only token or equivalent limited credential
  • Trigger point: A request to a self route that references or returns private resources
  • Why exploitation is possible: The endpoint authorization logic does not consistently enforce private-resource restrictions for public-only tokens

Why this happens

The underlying bug is an authorization decision that validates the presence or general type of a token without verifying whether its effective permissions cover the requested private resource. This is a form of CWE-863: Incorrect Authorization, where access-control enforcement fails to apply the required policy to a protected operation or resource.

Potential impact

  • Attackers may access private user-related resources
  • Sensitive account or profile information could be disclosed
  • Unauthorized self-service operations may be performed
  • Access-control boundaries between public and private data may be weakened
  • Exposed information could support further targeted attacks

General mitigation guidance

Mitigation generally focuses on enforcing authorization at every private-resource access decision rather than relying on token presence or route classification.

Common defensive patterns include:

  • Apply deny-by-default authorization for private resources
  • Validate token scope, audience, subject, and resource ownership together
  • Centralize policy checks so all self routes use consistent authorization logic
  • Separate public and private resource handling where practical
  • Minimize token privileges and issue narrowly scoped credentials
  • Avoid returning private fields unless an explicit policy check succeeds
  • Log authorization decisions and review anomalous access patterns

How teams detect issues like this

Detection approaches commonly include:

  • Static analysis for route handlers that authenticate tokens without checking scopes or resource visibility
  • Code review of every /api/v1/user branch involving public and private data
  • Policy tests using public-only tokens against private-resource cases
  • API gateway or service policies that deny private-resource access without the required claims
  • Integration tests covering token type, ownership, scope, and resource classification combinations
  • Monitoring for repeated private-resource requests made with limited tokens

Sources

SourceLink
blog.gitea.comblog.gitea.com/release-of-1.26.2/
github.comgithub.com/go-gitea/gitea/pull/37118
github.comgithub.com/go-gitea/gitea/releases/tag/v1.26.2
github.comgithub.com/go-gitea/gitea/security/advisories/GHSA-wrr5-99h5-gq57

Frequently asked

questions

It may be exploitable over the network wherever the affected /api/v1/user routes are exposed and accept public-only tokens.

The attacker generally needs a valid public-only token or another credential accepted by the affected routes. Full account privileges may not be required.

Enforce deny-by-default, resource-level authorization that verifies token scope and ownership before returning or modifying private resources.

Maintain centralized authorization policies, test every route with credentials of different privilege levels, and monitor for access attempts that cross public-private boundaries.

Find out what's already
exploitable in your codebase.