{"items":[{"id":"NVI-00016080","kind":"vulnerability","title":"Gitea: Branch Protection Bypass via PR Retargeting Preserves Stale `official` Approval Flag","revision":1,"unknowns":["Customer inventory, deployment, reachability and exploitation have not been inspected."],"lifecycle":"active","identifiers":["GHSA-w5pg-649r-p6gg","CVE-2026-58439"],"plain_summary":"GitHub lists this reviewed advisory for code.gitea.io/gitea. Published version ranges and source prerequisites are shown below; this is not an inspection of a visitor’s application.","review_status":"source_listed","control_topics":[],"public_actions":[{"summary":"Identify the exact component and deployed version, examine the linked publisher’s conditions, and retain evidence of any mitigation.","source_ids":["sr-1a48d417eb0a7702056713517b238f88"],"action_type":"investigate","limitations":"Confirm current vendor support, compatibility and deployment evidence. This report has not tested a fix in your system.","current_supported_target":null}],"schema_version":"1.1.0","source_metrics":[{"kind":"CVSS","as_of":"2026-07-21T20:15:34.000Z","value":"8.1 high","meaning":"GitHub source severity; exploitability and local consequence require separate evidence.","source_id":"sr-1a48d417eb0a7702056713517b238f88"}],"why_it_matters":"Published affected context helps an owner decide what evidence to gather. This report has not examined your application.","related_sources":[{"id":"sr-1a48d417eb0a7702056713517b238f88","url":"https://github.com/advisories/GHSA-w5pg-649r-p6gg","basis":"vendor_advisory","notes":"GitHub Advisory Database; CC-BY-4.0. Each advisory links its original attribution. Null normalizes fields.","title":"GHSA-w5pg-649r-p6gg","publisher":"GitHub Advisory Database","observed_at":"2026-11-03T22:34:39.734Z"}],"affected_context":[{"certainty":"source_listed","source_ids":["sr-1a48d417eb0a7702056713517b238f88"],"technology":"code.gitea.io/gitea","known_exclusions":[],"conditions_summary":"## Summary\n\nGitea does not re-evaluate the `official` flag on existing pull request reviews when a PR's target branch is changed. An attacker with write access to a repository can obtain an `official: true` approval on a PR targeting an unprotected branch, then retarget the PR to a protected branch (e.g., `master`). The approval, which would have been `official: false` if submitted against the protected branch, is preserved and satisfies the protected branch's required approvals, allowing the attacker to merge without legitimate maintainer approval.\n\n- Confirmed on Gitea **1.25.4** (`1.25.4+41-g96515c0f20`)\n\n## Vulnerability Details\n\n### Root Cause\n\nWhen a review is submitted on a pull request, Gitea computes the `official` flag by checking whether the reviewer is in the **target branch's** approval whitelist (`IsUserOfficialReviewer` in `models/git/protected_branch.go`). This flag is stored in the database as a boolean on the review record.\n\nWhen a PR's target branch is subsequently changed via `ChangeTargetBranch` (`services/pull/pull.go:218`), the function:\n- Updates `pr.BaseBranch`\n- Recalculates merge feasibility and divergence\n- Deletes old push comments\n- Creates a \"change t","public_affected_ranges":["< 1.27.0"]}],"null_published_at":"2026-11-04T10:04:27.881Z","source_updated_at":"2026-07-21T20:15:34.000Z","source_disclosed_at":"2026-07-21T20:14:12.000Z","is_synthetic_fixture":false,"null_last_reviewed_at":null,"public_change_summary":"First indexed by Null; source disclosure date is shown separately.","null_first_observed_at":"2026-11-03T22:34:39.734Z"}],"next_cursor":null,"snapshot_revision":"42594"}