8.5high
Gitea maintainer-edit permissions allow unauthorized commits to readable repositories
- Severity
- 8.5high CVSS:3.1 by Gitea
- Exploit likelihood
- 0.36% (higher than 31% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Gitea
- Also known as
- GHSA-mm7c-rhg6-qr4rGO-2026-5510
Description
Gitea versions up to and including 1.26.1 allow the Allow edits from maintainers permission path to authorize commits to repositories that the user can read but should not be able to write.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Gitea Gitea Open Source Git Server | up to 1.26.1 | CVE List |
| code.gitea.io/gitea (Go) | before 1.26.2 | GitHub Advisory Database, Go Vulnerability Database |
All scores
| Gitea | 8.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N |
| GitHub | 8.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
Gitea versions up to and including 1.26.1 allow the Allow edits from maintainers permission path to authorize commits to repositories that the user can read but should not be able to write.
GitHub Advisory Database
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.
Go Vulnerability Database
Gitea: Authorization Bypass via "Allow edits from maintainers" allows unauthorized commits to any readable repo in code.gitea.io/gitea
NVD (es)
Versiones de Gitea hasta la 1.26.1 inclusive permiten que la ruta de permiso ’Permitir ediciones de los mantenedores’ autorice confirmaciones a repositorios que el usuario puede leer pero en los que no debería poder escribir.
References
| https://github.com/go-gitea/gitea/security/advisories/GHSA-mm7c-rhg6-qr4r | advisory, exploit, vendor-advisory, web | |
| https://github.com/go-gitea/gitea/pull/37479 | patch | |
| https://github.com/go-gitea/gitea/pull/37484 | patch | |
| https://github.com/go-gitea/gitea/releases/tag/v1.26.2 | release-notes | |
| https://blog.gitea.com/release-of-1.26.2/ | release-notes | |
| https://github.com/go-gitea/gitea | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-26231 changed 2026-07-07 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-mm7c-rhg6-qr4r changed 2026-06-25 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-5510 changed 2026-06-25 | CC-BY-4.0 |
| NVD | CVE-2026-26231 changed 2026-10-25 | Public domain |