GHSA-mm7c-rhg6-qr4r
HIGHGHSA-mm7c-rhg6-qr4r is a high-severity (CVSS 8.5) CWE-863 vulnerability in code.gitea.io/gitea. O3 Security confirms whether GHSA-mm7c-rhg6-qr4r is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Gitea: Authorization Bypass via "Allow edits from maintainers" allows unauthorized commits to any readable repo
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for GHSA-mm7c-rhg6-qr4r.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
GHSA-mm7c-rhg6-qr4r plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 360,482 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
code.gitea.io/giteaReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Summary
Any authenticated low-privilege user with read access to a repository can push arbitrary commits directly to that repository, bypassing all write-access checks.
Vulnerability
Gitea's "Allow edits from maintainers" PR option can be abused via reverse-fork PRs:
- The web UI PR-create endpoint binds
allow_maintainer_edit=truewithout verifying that the submitter has write access to the HEAD repository. - Gitea allows creating a PR where BASE = attacker's fork and HEAD = upstream target. The attacker is "maintainer" of the BASE (their own fork), so the flag is set against the upstream HEAD.
- On
git pushover HTTP/SSH, Gitea relaxes the required access mode toReadwhenSupportProcReceiveis enabled (routers/web/repo/githttp.go,routers/private/serv.go) and defers enforcement to the pre-receive hook. - The pre-receive hook calls
CanMaintainerWriteToBranch(models/issues/pull_list.go), which finds the malicious PR, seesAllowMaintainerEdit=true, and checks whether the pusher has write access to the BASE repo. Since BASE is the attacker's own fork, the check passes and the push is authorized against the upstream.
Exploitation
- Attacker forks the target repository.
- Attacker visits the web compare endpoint and creates a PR with
BASE = their_fork,HEAD = upstream, and "Allow edits from maintainers" checked. - Attacker clones their fork, makes a commit, and runs
git push <upstream_url> <branch>— the push is accepted.
Reproduction
python3 poc.py --repo http://gitea:3000/victim/repo --user attacker --password attacker_pass
Expected output:
[+] target: victim/my_repo default branch: main
[*] forking -> attacker/my_repo_pocfork (202)
[+] fork ready
[+] malicious PR created (BASE=attacker fork, HEAD=upstream)
remote: . Processing 1 references
remote: Processed 1 references in total
To http://192.168.101.20:3000/victim/my_repo.git
e5c07b3..9a0b884 main -> main
[+] latest commit on victim/my_repo@main: 'PoC: unauthorized commit via maintainer-edit bypass'
[+] CONFIRMED: unauthorized push to upstream succeeded.
A PWNED.txt file will appear on the target repo's default branch, committed by the attacker who has no write access.
Impact
Full repository compromise. Any logged-in user can backdoor any repository they can read, including all public repositories on the instance.
Suggested Fix
Two independent checks are missing; both should be added for defense in depth:
- At PR creation: before setting
AllowMaintainerEdit = true, verify the submitter has write access to the HEAD repository. - In
CanMaintainerWriteToBranch: verify that the PR's HEAD repo matches the repository being pushed to, and that the PR was opened by a legitimate owner/writer of the HEAD repository. Do not trustAllowMaintainerEditsolely based on BASE write access.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | code.gitea.io/gitea | all versions | 1.26.2 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for code.gitea.io/gitea. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update code.gitea.io/gitea to 1.26.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-mm7c-rhg6-qr4r is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-mm7c-rhg6-qr4r is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-mm7c-rhg6-qr4r. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-mm7c-rhg6-qr4r in your dependencies?
O3 detects GHSA-mm7c-rhg6-qr4r across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.