CVE-2026-60004: Remote Code Execution in Gitea diffpatch API via Git Hook Installation
- Vendor
- Gitea
CVE-2026-60004 is a code-injection vulnerability in Gitea versions 1.17 through 1.27.0 that permits remote command execution through the diffpatch API. The vulnerable workflow processes attacker-controlled patches in a shared temporary bare Git clone. Repeated submission of a crafted patch abuses Git's three-way merge fallback to write an executable hook into the clone's active hook directory, despite cached patch processing. A subsequent Git index operation invokes the hook, executing attacker-supplied shell commands with the privileges of the Gitea operating-system service account. Exploitation requires repository write access, but open self-registration can allow an attacker without existing credentials to register an account and create a repository. The vulnerability is actively exploited and is fixed in Gitea 1.27.1.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation compromises the confidentiality, integrity, and availability of resources accessible to the Gitea service account. Attackers can steal or modify repositories, access application configuration, environment variables, database contents, password hashes, deployment keys, OAuth tokens, and integration credentials. Observed exploitation has included source-code and credential theft, backdoor deployment, persistent access, cryptocurrency mining, and lateral movement. Access to additional infrastructure depends on exposed credentials, service-account permissions, and network reachability; the vulnerability does not inherently grant operating-system root privileges.
Mitigation
If you can’t patch tonight, do this now.
Until upgrading, disable or restrict access to the diffpatch API route through a reverse proxy or equivalent access control. Disable unnecessary open registration, restrict repository creation and write permissions to trusted users, and limit Gitea access to trusted networks or VPNs. Disabling registration alone does not prevent exploitation by existing or compromised accounts with repository write access. Run Gitea under a dedicated least-privileged service account. Where operationally feasible, use non-executable temporary clone storage as an additional defense-in-depth measure, not a substitute for patching.
Remediation
Patch, then assume compromise.
Upgrade affected Gitea installations to version 1.27.1 or later immediately. Investigate previously exposed instances for compromise even after patching, including unauthorized users, repositories, Git hooks, repository changes, unexpected diffpatch activity, and commands executed by the Gitea service account. If compromise is suspected, rotate accessible passwords, tokens, SSH keys, deployment credentials, and application secrets. Rebuild confirmed malware-infected hosts from trusted images rather than relying on live cleanup.
Exploits
14 exploits validated by Mallory's analysis.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2026-60004 exploited in the wild?
- Yes. As of Nov 15, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Aug 25, 2026.
- Is there a public exploit for CVE-2026-60004?
- Yes. Mallory tracks 14 public exploits or proofs of concept for CVE-2026-60004, the earliest disclosed Jul 29, 2026.
- Is there a patch for CVE-2026-60004?
- Upgrade affected Gitea installations to version 1.27.1 or later immediately. Investigate previously exposed instances for compromise even after patching, including unauthorized users, repositories, Git hooks, repository changes, unexpected diffpatch activity, and commands executed by the Gitea service account.
- What products are affected by CVE-2026-60004?
- Gitea.
- How severe is CVE-2026-60004?
- CVE-2026-60004 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 24.0% (98th percentile) as of Nov 15, 2026.
Recent activity
204 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.