Yonatan-Pl

#8213of 56,330
35.7Total CVSS
Vulnerabilities · 4
High
2
Critical
2
PT-2026-63305
8.1
2026-07-21
Gitea · Gitea · CVE-2026-58439
**Name of the Vulnerable Software and Affected Versions** Gitea versions prior to 1.27.0 **Description** Gitea fails to re-evaluate the `official` flag on existing pull request reviews when the target branch of a pull request is changed. An attacker with write access to a repository can obtain an `official: true` approval on a pull request targeting an unprotected branch and then retarget that pull request to a protected branch. Because the system does not re-verify if the reviewer is in the new target branch's approval whitelist, the stale approval is preserved. This allows the attacker to satisfy protected branch requirements and merge changes without legitimate maintainer approval, effectively bypassing branch protection and escalating privileges. Technical details include the following: - **API Endpoints:** `/api/v1/repos/{owner}/{repo}/pulls` and `/api/v1/repos/{owner}/{repo}/pulls/{index}/reviews` are used during the exploitation process. - **Vulnerable Parameters or Variables:** The `official` flag is stored as a boolean on the review record and is not updated during the `ChangeTargetBranch` process. - **Function Names:** The issue involves `IsUserOfficialReviewer()`, `ChangeTargetBranch()`, and `GetGrantedApprovalsCount()`, which fails to re-check the whitelist against the new branch. **Recommendations** Update Gitea to version 1.27.0 or later. As a temporary mitigation, restrict write access to repositories to only trusted users to prevent unauthorized retargeting of pull requests.