Critical Gitea RCE Lets Repository Writers Execute Shell Commands via Git Hooks
Vulnerability Disclosure · 6 sources · Updated 3mo ago · First seen Jul 29, 2026

Gitea has patched a critical remote code execution flaw, CVE-2026-60004, affecting versions 1.17 through 1.27.0, after researchers showed that attacker-controlled patch content sent to the POST /api/v1/repos/{owner}/{repo}/diffpatch endpoint could be turned into a malicious Git hook and executed as the Gitea service account. The bug carries a CVSS 9.8 rating and stems from patch application inside a shared bare temporary clone, where Git's three-way fallback can activate the planted hook; exploitation also depends on Git 2.32 or later. Gitea fixed the issue in version 1.27.1 and said its cloud instances would be upgraded automatically.
Why it matters
Impact assessment
CVE-2026-60004 is a critical Gitea server-side remote code execution issue that affects organizations running self-hosted Gitea versions 1.17 through 1.27.0, especially internet-exposed instances with open self-registration enabled. The impact is severe because successful exploitation yields shell command execution as the Gitea service account and can expose source code, secrets, database credentials, OAuth tokens, and potentially downstream build and supply-chain artifacts.
The exposure is broad across self-hosted Gitea deployments but exploitation is most practical on publicly accessible instances where attackers can self-register and create repositories. Public reporting states no confirmed in-the-wild exploitation as of late July 2026, but public proof-of-concept details exist, which materially raises near-term exploitation risk.
Affected populations
- Organizations using self-hosted Gitea for source control, issue tracking, and code review
- Development, DevOps, CI/CD, and software supply-chain environments
- Public-facing Gitea instances with open registration enabled
- Any deployment where users have repository write access
Severity and business impact
- Remote code execution as the operating system account running Gitea
- Exposure of app.ini, application secrets, environment variables, mounted repositories, database credentials, OAuth tokens, and integration credentials
- Potential tampering with repositories, build outputs, and downstream artifacts
- Risk of lateral movement to reachable internal services depending on host isolation and service account privileges
- Operational disruption from server compromise, repository integrity loss, and incident response requirements
Scope and exploitation status
- Affects Gitea versions 1.17 through 1.27.0 inclusive
- Gitea Cloud instances were reported to be upgraded automatically
- Publicly accessible deployments are at highest risk if registration is open and diffpatch is enabled
- No confirmed exploitation in the wild was reported in the cited sources, but public PoC and detection content are available


