CVE-2026-60004 is a critical (CVSS 9.8) code-injection vulnerability in the self-hosted Git service Gitea. A user with ordinary write access to any repository can send a crafted patch through the diffpatch API endpoint, plant an executable Git hook, and run arbitrary shell commands as the Gitea service account.
Because Gitea ships with open self-registration enabled by default, attackers can create the account they need without any prior credentials — collapsing the exploit into a near-unauthenticated remote code execution. CISA added the flaw to its Known Exploited Vulnerabilities catalog on August 26, 2026 after in-the-wild cryptomining, and Shadowserver counted 8,393 exposed instances two days later.
◈ Table of Contents
Background & Affected Versions
Phase 01Gitea is a lightweight, self-hosted Git platform widely deployed inside development teams, CI/CD estates, and homelabs as an alternative to GitHub Enterprise or GitLab. That footprint — often exposed to the internet and rarely centrally patched — is exactly what makes CVE-2026-60004 attractive to opportunistic operators.
The bug is classified as CWE-94 (code injection). The diffpatch API, intended to apply a patch to a repository through the web interface, fails to properly constrain what an authenticated-but-low-privilege user can write. The result is the ability to plant a server-side Git hook, which Gitea executes on the next repository event, yielding shell access as the service account.
| Attribute | Value |
|---|---|
| CVE ID | CVE-2026-60004 |
| CVSS v3.1 | 9.8 Critical |
| Weakness | CWE-94 — Code Injection |
| Affected versions | Gitea 1.17.0 through 1.27.0 |
| Fixed version | Gitea 1.27.1 (released July 27, 2026) |
| Privilege required | Repository write access (obtainable via open registration) |
| CISA KEV | Added August 26, 2026 — federal patch deadline August 28, 2026 |
| Credited researcher | Shai Rod (NightRang3r) |
NVD assigns a 9.8 base score because default deployments allow self-registration. If your instance disables registration, the flaw still applies to any existing user with write access to a single repository — treat it as critical regardless.
How the Exploit Works
Phase 02The exploit chains a low bar for access with a server-side execution primitive. Git hooks are scripts that Gitea runs automatically on repository events such as pushes; the diffpatch weakness lets an attacker write into that hook path when they should not be able to.
In default configurations, Gitea permits self-registration with no email confirmation. An attacker signs up, or reuses an existing low-privilege developer account, and obtains write access to at least one repository.
DISABLE_REGISTRATION=false, REGISTER_EMAIL_CONFIRM=false, ENABLE_OPENID_SIGNUP=true.The attacker submits a crafted patch to the diffpatch API. Because the endpoint does not adequately constrain the write path, the patch is used to place an executable Git hook — a script Gitea trusts and runs server-side.
On the next triggering event, Gitea runs the planted hook, executing arbitrary shell commands with the privileges of the Gitea process. In observed activity this was used to fetch and run a cryptocurrency miner.
- Sustained CPU load above 70% on the host
- Clears
LD_PRELOADandLD_LIBRARY_PATHbefore running - Kills competing high-CPU processes to maximise its own hashrate
- Fetches an architecture-specific payload, executes it, then deletes it
No mining pool, wallet address, IP, or file hash was disclosed by the reporting party. Do not treat the behavioural traits above as signatures — hunt on behaviour, not on invented indicators.
Active Exploitation & Exposure
Phase 03In-the-wild abuse was surfaced when a developer noticed anomalous CPU consumption on a hosted Gitea instance; the hosting provider HOSTKEY corroborated the anomaly. CISA followed with a KEV listing on August 26, 2026, giving U.S. federal agencies until August 28 to remediate — a compressed three-day window that signals confirmed, ongoing exploitation.
| Signal | Detail |
|---|---|
| Exposed instances | 8,393 internet-facing Gitea servers (Shadowserver scan, August 27, 2026) |
| Observed payload | Cryptocurrency miner dropped via planted Git hook |
| Patch availability | 1.27.1 shipped July 27, 2026 — roughly a month before mass scanning |
| Regulatory driver | CISA KEV binding operational directive, 3-day federal deadline |
The one-month gap between patch (Jul 27) and mass exploitation (late Aug) is the recurring pattern for self-hosted dev tooling: teams treat Gitea as infrastructure they forget, not software they patch. Add it to your monthly vulnerability review scope.
Detection & Hunt Queries
Phase 04Gitea typically runs on Linux, so the highest-value telemetry comes from host process and file monitoring (auditd, Sysmon for Linux, or EDR) plus the Gitea application logs. Below are starting points for the three most common stacks. Tune paths to your deployment (/var/lib/gitea, /data/git, or your custom root).
The cleanest single indicator is causality: the Gitea service account should almost never be the parent of an interactive shell or a network downloader. Alert on that relationship and you catch the class of attack, not one payload.
Mitigation & Hardening
Phase 05Upgrading to Gitea 1.27.1+ closes the diffpatch code-injection path. This is the only complete fix; the hardening steps below reduce exposure but do not eliminate the vulnerability for existing write-capable users.
Disabling open registration removes the anonymous path to a write-capable account, downgrading a near-unauthenticated exploit to an insider/authenticated one.
hooks/ directory and review recently created accounts.If your instance was internet-exposed and unpatched during late August 2026, assume possible compromise: check for the miner CPU signature, unexpected hooks, and unknown user accounts before restoring trust.
MITRE ATT&CK Mapping
Phase 06| Tactic | Technique | How it appears here |
|---|---|---|
| Initial Access | T1190 | Exploit Public-Facing Application — the exposed Gitea web service |
| Execution | T1059 | Command & Scripting Interpreter — shell run by the planted hook |
| Persistence | T1543 | Create/Modify System Process — malicious Git hook re-triggers on events |
| Impact | T1496 | Resource Hijacking — cryptocurrency miner consuming host CPU |
Sources & References
Phase 07Patch first, then hunt. Run CyberHawk's IOC Scanner against your Gitea hosts, and browse the Threat Intel feed for the latest actively-exploited CVEs in your stack. Self-hosted dev tooling deserves the same patch cadence as your edge appliances.
◈ Stay Connected
Follow CyberHawk Threat Intel for threat intelligence, deployment guides and hands-on SOC tooling content.
"They can't exploit you if you are the Exploit."