Skip to main content

Gitea CVE-2026-26231

| EUVDEUVD-2026-41627 HIGH
Incorrect Authorization (CWE-863)
2026-06-16 https://github.com/go-gitea/gitea GHSA-mm7c-rhg6-qr4r
8.5
CVSS 3.1 · Vendor: https://github.com/go-gitea/gitea
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate as low-privilege user
  2. Delivery
    Fork target repository
  3. Exploit
    Create reverse PR (BASE=fork, HEAD=upstream) with maintainer-edit flag
  4. Execution
    Commit malicious change locally
  5. Persist
    Push directly to upstream over HTTP/SSH
  6. Impact
    Backdoored code lands on default branch

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization logic validation
MITRE ATT&CK

1 technique across 1 tactic: Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires (1) network access to the Gitea web and Git HTTP/SSH endpoints, (2) any authenticated low-privilege account on the instance (read access to the target repository is sufficient - no write, fork-approval, or admin rights are needed), and (3) the instance must have SupportProcReceive enabled (the default on modern Gitea, used to power agit workflows), since the relaxed access-mode check in routers/web/repo/githttp.go and routers/private/serv.go is what defers enforcement to the vulnerable pre-receive hook. The target repository must be one the attacker can read and fork; entirely private repos they cannot view are not exposed. No user interaction by a victim is required, and the attack works against the repository's default branch.

Impact

The CVSS 3.1 vector AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N (8.5) accurately reflects a network-reachable, low-complexity flaw that needs only any low-privilege account, no user interaction, with a scope change (compromise of repositories the attacker does not own) and high integrity impact. Real-world risk is high for any multi-tenant Gitea instance that permits user registration or hosts public repositories - a single throwaway account is sufficient to backdoor every readable repo on the instance, which makes this a supply-chain-grade threat for code hosting. Publicly available exploit code exists in the form of poc.py linked from the GHSA advisory, raising practical exploitability further. No EPSS score or CISA KEV listing was provided in the input, so widespread or targeted exploitation cannot be confirmed at this time; analysts should treat exposure of pre-1.26.2 instances as urgent regardless. CVSS C:L is conservative - confidentiality impact is effectively limited to what was already readable, which is consistent with the bypass being write-side only.

Exploit ScenarioDerived

An attacker registers (or uses any existing low-privilege account) on a target Gitea instance, forks a high-value public repository, then opens a PR with BASE set to their own fork and HEAD set to the upstream repository, ticking 'Allow edits from maintainers'. They clone their fork, craft a malicious commit (for example, backdooring a build script or CI workflow), and run git push against the upstream URL - the push is accepted and lands on the upstream default branch. A working poc.py is attached to the advisory and demonstrates the full chain end-to-end, dropping a PWNED.txt file on the victim repo's default branch.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 17, 2026

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.

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.

Affected VersionsENISA

Gitea Open Source Git Server 0 ≤1.26.1

Affected Packages

go code.gitea.io/gitea fix: 1.26.2
euvd gitea_open_source_git_server no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

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.

Know when Gitea gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/go-gitea/gitea) PRIMARY 8.5 HIGH
AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N
vuln.today AI 7.7 HIGH

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.

3.1 AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:H/SA:N
SUSE HIGH

Primary rating from Vendor (https://github.com/go-gitea/gitea).

CVSS VectorVendor: https://github.com/go-gitea/gitea

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
Low
Integrity
High
Availability
None

DescriptionCVE.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:

  1. The web UI PR-create endpoint binds allow_maintainer_edit=true without verifying that the submitter has write access to the HEAD repository.
  2. 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.
  3. On git push over HTTP/SSH, Gitea relaxes the required access mode to Read when SupportProcReceive is enabled (routers/web/repo/githttp.go, routers/private/serv.go) and defers enforcement to the pre-receive hook.
  4. The pre-receive hook calls CanMaintainerWriteToBranch (models/issues/pull_list.go), which finds the malicious PR, sees AllowMaintainerEdit=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

  1. Attacker forks the target repository.
  2. Attacker visits the web compare endpoint and creates a PR with BASE = their_fork, HEAD = upstream, and "Allow edits from maintainers" checked.
  3. Attacker clones their fork, makes a commit, and runs git push <upstream_url> <branch> - the push is accepted.

Reproduction

bash
python3 poc.py --repo http://gitea:3000/victim/repo --user attacker --password attacker_pass

poc.py

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:

  1. At PR creation: before setting AllowMaintainerEdit = true, verify the submitter has write access to the HEAD repository.
  2. 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 trust AllowMaintainerEdit solely based on BASE write access.

Executive ViewAI

Why It Matters

Gitea versions 1.26.1 and earlier contain an authorization bypass allowing any authenticated user to push code commits to repositories they can view, including public repositories. This enables attackers with read-level access to inject unauthorized code, directly compromising repository integrity and creating supply chain risk across organizations relying on Gitea for code management.

Business Impact: High
Compensating Controls

Vendor-released patch: Gitea 1.26.2. Until patching: restrict repository read access to users who require it; disable 'Allow edits from maintainers' flag on all pull requests; implement mandatory multi-reviewer approval on all commits; enable comprehensive audit logging and monitor for anomalous push activity.

Threat Intelligence Overview

EPSS Score
0.3%
Top 79% exploitable
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

More in Gitea

View all
CVE-2026-60004 CRITICAL POC
9.8

Remote code execution in Gitea (self-hosted Git service) via a code-injection flaw (CWE-94) allows attackers to run arbi

CVE-2026-27771 HIGH POC
8.2 Jul 03

Broken access control in Gitea's Composer package registry (versions up to and including 1.26.1) lets remote attackers r

CVE-2022-30781 HIGH POC
7.5 May 16

Gitea before 1.16.7 does not escape git fetch remote. Rated high severity (CVSS 7.5), this vulnerability is remotely exp

CVE-2020-14144 HIGH POC
7.2 Oct 16

The git hook feature in Gitea 1.1.0 through 1.12.5 might allow for authenticated remote code execution in customer envir

CVE-2024-6886 CRITICAL POC
10.0 Aug 06

Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in Gitea Gitea

CVE-2026-72867 CRITICAL POC
9.9 Aug 10

Authenticated command injection in Dokploy (self-hostable PaaS) versions 0.29.3 through 0.29.12 lets a low-privileged us

CVE-2026-20896 CRITICAL POC
9.8 Jul 03

Reverse-proxy authentication bypass in the official Gitea Docker image (versions up to and including 1.26.2) allows any

CVE-2026-59774 CRITICAL POC
9.8

Path traversal in Gitea's Org-mode (`.org`) markup renderer allows an attacker who can get Org-mode content rendered by

CVE-2026-58053 CRITICAL POC
9.4 Jun 28

Container escape in Gitea act_runner (Docker backend, through act 0.262.0) lets an authenticated user with workflow-exec

CVE-2019-11229 HIGH POC
8.8 Apr 15

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

CVE-2026-57894 HIGH POC
8.5 Jul 21

Server-side request forgery and internal repository exfiltration in Gitea before 1.27.0 lets a low-privileged authentica

CVE-2026-24791 HIGH POC
8.1 Jun 17

Authorization bypass in Gitea versions 1.22.3 through 1.26.1 allows holders of `public-only` access tokens or OAuth gran

Vendor 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

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy