Severity by source
AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N
Network-reachable, any low-priv account suffices (PR:L), no user interaction; scope changes to repos outside attacker control (S:C); high integrity impact, no confidentiality or availability beyond what was already readable.
Primary rating from Vendor (https://github.com/go-gitea/gitea).
CVSS VectorVendor: https://github.com/go-gitea/gitea
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N
Lifecycle Timeline
3DescriptionCVE.org
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_passExpected 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.
AnalysisAI
Authorization bypass in Gitea versions up to and including 1.26.1 allows any authenticated user with mere read access to push arbitrary commits directly to any repository they can view, including all public repositories on the instance. The flaw stems from the 'Allow edits from maintainers' pull request flag being trusted without verifying the PR submitter actually owns write access on the HEAD side, enabling reverse-fork PRs to grant unauthorized push rights to upstream targets. Publicly available exploit code exists (a working poc.py is attached to the advisory), and the issue is fixed in Gitea 1.26.2.
Technical ContextAI
Gitea is a self-hosted Git service written in Go (CPE pkg:go/code.gitea.io_gitea). The vulnerability is a textbook CWE-863 Incorrect Authorization issue across two enforcement layers. The web PR-create endpoint sets AllowMaintainerEdit=true on PRs without checking whether the submitter has write access to the HEAD repository. When SupportProcReceive is enabled, routers/web/repo/githttp.go and routers/private/serv.go intentionally relax the required Git access mode to Read and defer enforcement to the pre-receive hook. That hook's CanMaintainerWriteToBranch helper (models/issues/pull_list.go) only verifies the pusher has write to the BASE repo of the matching PR, never validating that BASE is actually downstream of HEAD. By inverting BASE and HEAD, an attacker becomes 'maintainer' of their own fork, and the BASE-side write check trivially passes while the push is applied to the upstream HEAD.
RemediationAI
Vendor-released patch: upgrade Gitea to 1.26.2 or later, which is the version that addresses GHSA-mm7c-rhg6-qr4r and adds the missing authorization checks. Operators who cannot immediately upgrade should consider disabling the proc-receive code path by setting SupportProcReceive (and related agit/AGit features) to false in app.ini, since the bypass depends on Gitea relaxing the required access mode to Read and deferring to the pre-receive hook; the trade-off is loss of agit-style 'push to create PR' workflows. As a further compensating control, restrict new account creation (DISABLE_REGISTRATION=true) and audit recent pushes to public repositories for unexpected commits or contributors, because any authenticated account could have abused this. The authoritative advisory is https://github.com/go-gitea/gitea/security/advisories/GHSA-mm7c-rhg6-qr4r.
Broken access control in Gitea's Composer package registry (versions up to and including 1.26.1) lets remote attackers r
Gitea before 1.16.7 does not escape git fetch remote. Rated high severity (CVSS 7.5), this vulnerability is remotely exp
The git hook feature in Gitea 1.1.0 through 1.12.5 might allow for authenticated remote code execution in customer envir
Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in Gitea Gitea
Container escape in Gitea act_runner (Docker backend, through act 0.262.0) lets an authenticated user with workflow-exec
models/repo_mirror.go in Gitea before 1.7.6 and 1.8.x before 1.8-RC3 mishandles mirror repo URL settings, leading to rem
An issue was discovered in Gitea through 1.11.5. Rated high severity (CVSS 7.5), this vulnerability is remotely exploita
Missing Authorization in GitHub repository go-gitea/gitea prior to 1.16.4. Rated high severity (CVSS 7.1), this vulnerab
Open Redirect on login in GitHub repository go-gitea/gitea prior to 1.16.5. Rated medium severity (CVSS 6.1), this vulne
Reverse-proxy authentication bypass in the official Gitea Docker image (versions up to and including 1.26.2) allows any
Branch-protection bypass in Gitea's self-hosted Git server (all versions before 1.26.0) allows a user with push access t
Migration transport protections in Gitea are bypassed for Git LFS operations, affecting all self-hosted instances before
Same weakness CWE-863 – Incorrect Authorization
View allSame technique Authentication Bypass
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP6 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-41627
GHSA-mm7c-rhg6-qr4r