/

CVE-2026-58443

Severity:

CRITICAL RISK

(9.1)

Authorization Bypass (CWE-863) in Pull Request Branches

CVE-2026-58443

Deferred

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-863

Impact:

Unauthorized modification of private repository code

Severity:

CRITICAL RISK

(9.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 critical authorization flaw allows a token intended to operate only on public repositories to update the head branch of a pull request associated with a private repository. Under affected permission and pull request configurations, an attacker may alter private-repository code without having the intended repository access.

Affected context

The vulnerability occurs in repository and pull request workflows that use tokens with public-only scope while processing pull requests whose head branches are hosted in private repositories. Risk exists when authorization checks evaluate the public repository context but fail to independently verify access to the private head repository before accepting branch updates.

Exploit preconditions

  • Attack surface: Repository pull request and branch-update APIs
  • Required access: A valid token or workflow capability restricted to public repositories
  • Trigger point: An operation that updates the head branch associated with a pull request
  • Authorization condition: The service accepts the public-repository permission context without validating access to the private head repository
  • Why exploitation is possible: Repository-bound authorization is not consistently enforced across the pull request relationship

Why this happens

The underlying bug is an authorization-boundary failure. A request associated with a public repository is permitted to modify a related private pull request head branch even though the caller lacks authorization for that private repository. This maps to CWE-863, Incorrect Authorization, because the system evaluates an insufficient permission context and allows an operation outside the caller's intended scope.

Potential impact

  • An attacker may modify code in a private repository
  • Malicious changes could be introduced into pull request review workflows
  • CI pipelines may execute attacker-controlled changes
  • Source code integrity and software supply-chain trust could be weakened
  • Downstream artifacts or deployments could be affected

General mitigation guidance

Mitigation generally focuses on enforcing authorization independently for every repository and branch affected by an operation. Secure-by-default designs should deny cross-repository updates unless the token explicitly grants access to both the pull request context and the private head repository. Authorization should be based on the target resource rather than inferred from a related public resource, while token scope and workflow privileges should be minimized. Repository and branch ownership should be revalidated at the point of mutation, and untrusted pull request changes should be isolated from sensitive credentials and deployment permissions.

How teams detect issues like this

Detection can include static and dynamic checks for authorization decisions that derive target-resource permissions from a related repository, pull request, or branch. Code review should examine cross-repository API handlers, token-scope translation, branch mutation paths, and missing ownership or visibility checks. Policy enforcement can require explicit authorization for every target repository, with tests covering public-to-private pull request relationships, token scope boundaries, and denied branch updates. Audit logs should be reviewed for private branch mutations performed by public-only identities.

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-xxjv-752h-3vp2

Frequently asked

questions

It may be exploitable through repository or pull request APIs when an attacker

possesses a valid public-only token and the affected cross-repository workflow

accepts branch updates.

Not necessarily. The issue specifically concerns cases where the system fails to

require authorization for the private pull request head repository.

Authorize every mutation against the actual target repository and branch, and

deny the operation unless the token explicitly has the required private-resource

permissions.

Use least-privilege tokens, maintain strict repository-boundary checks, isolate

untrusted pull request workflows, and test authorization behavior across public

and private repository combinations.

Find out what's already
exploitable in your codebase.