Gitea: Public-only repository tokens can update private PR head branches (CVE-2026-58443)
Gitea contains a critical vulnerability (CVE-2026-58443) where a token restricted to public repositories with write permissions can update the head branch of a private pull request. This occurs because the public-only restriction is checked against the public base repository route but not re-applied when updating the private head repository branch. Consequently, the token can push changes into private branches indirectly, bypassing intended access controls.
AI Analysis
Technical Summary
The vulnerability in Gitea arises from improper enforcement of the 'public-only' token restriction in the pull request update API endpoint POST /api/v1/repos/{public-owner}/{public-repo}/pulls/{index}/update. While the token is validated as public-only against the public base repository route, the subsequent authorization for updating the pull request head branch uses normal user RBAC on the head repository without re-checking the public-only restriction. If the head repository is private, this allows a public-only token to push commits into the private head branch, violating access controls. The issue stems from the route-level public-only check being applied only to the base repository and not to the private head repository during the update operation.
Potential Impact
An attacker or user possessing a public-only, write:repository token can indirectly modify private repository branches by updating pull request head branches. This bypasses the intended access control restrictions, potentially leading to unauthorized code changes in private repositories. The vulnerability does not disclose data but allows integrity violations by pushing commits into private branches without direct write access. This can compromise the integrity of private codebases.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid using public-only tokens with write permissions on repositories involved in pull requests that include private head branches. Monitor vendor communications for patches addressing this issue and apply them promptly once released.
Gitea: Public-only repository tokens can update private PR head branches (CVE-2026-58443)
Description
Gitea contains a critical vulnerability (CVE-2026-58443) where a token restricted to public repositories with write permissions can update the head branch of a private pull request. This occurs because the public-only restriction is checked against the public base repository route but not re-applied when updating the private head repository branch. Consequently, the token can push changes into private branches indirectly, bypassing intended access controls.
CVSS v3.1
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Gitea arises from improper enforcement of the 'public-only' token restriction in the pull request update API endpoint POST /api/v1/repos/{public-owner}/{public-repo}/pulls/{index}/update. While the token is validated as public-only against the public base repository route, the subsequent authorization for updating the pull request head branch uses normal user RBAC on the head repository without re-checking the public-only restriction. If the head repository is private, this allows a public-only token to push commits into the private head branch, violating access controls. The issue stems from the route-level public-only check being applied only to the base repository and not to the private head repository during the update operation.
Potential Impact
An attacker or user possessing a public-only, write:repository token can indirectly modify private repository branches by updating pull request head branches. This bypasses the intended access control restrictions, potentially leading to unauthorized code changes in private repositories. The vulnerability does not disclose data but allows integrity violations by pushing commits into private branches without direct write access. This can compromise the integrity of private codebases.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid using public-only tokens with write permissions on repositories involved in pull requests that include private head branches. Monitor vendor communications for patches addressing this issue and apply them promptly once released.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-xxjv-752h-3vp2
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-58443"]
- Ecosystems
- ["Go"]
- Database Specific Severity
- CRITICAL
- Cvss Version
- 3.1
Threat ID: 6a600ab79c2644c7f8fe24f9
Added to database: 07/22/2026, 00:11:35 UTC
Last enriched: 07/22/2026, 00:50:05 UTC
Last updated: 07/22/2026, 01:56:11 UTC
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.