CVE-2026-60004 Explained: Gitea Diffpatch Code Injection Exploited to Achieve Remote Code Execution

Proactive Security for the AI Era
NodeZero continuously and autonomously pentests infrastructure, identity, cloud, and now web applications, chaining weaknesses across every domain the way real attackers do. Every finding ships with replayable proof showing exploitable business impact, not theoretical risk.
CVE-2026-60004 is a code injection vulnerability in Gitea, the widely self-hosted Git service used by development teams that want source code hosting on their own infrastructure instead of a third-party SaaS platform. The flaw lives in Gitea's diffpatch API endpoint: a user with write access to a repository can submit a specially crafted patch to that endpoint twice, which causes Gitea to write an executable file into Git's own hook directory and then execute it. The result is command execution with the privileges of whatever account runs the Gitea service, on the underlying host.
What makes this vulnerability far more dangerous than a typical write-access-required bug is a default Gitea setting most administrators never think to change: self-registration. Gitea ships with open self-registration enabled out of the box. On a default-configured instance, an outside visitor with no prior account, no invitation, and no credentials can register, create a repository, and reach the exact code path this vulnerability requires. The CVE record technically classifies the flaw as requiring an authenticated user, but that authentication barrier is trivial to clear by design default. For any Gitea instance that has not deliberately disabled self-registration, the practical exposure is effectively the same as an unauthenticated remote code execution bug.
CISA added CVE-2026-60004 to its Known Exploited Vulnerabilities (KEV) catalog on August 25, 2026, based on confirmed active exploitation, and ordered US federal civilian executive branch agencies to remediate within three days, by August 28, 2026, under Binding Operational Directive 26-04. Shadowserver scans found roughly 8,393 internet-exposed Gitea instances still vulnerable as of around August 27, 2026. Gitea shipped a fix in version 1.27.1, released July 27, 2026. This article covers what our data confirms, cites sources directly, and flags what remains unverified before you close this out as a routine patch.
Risk Summary: What CVE-2026-60004 Means for Self-Hosted Gitea Instances
Teams choose to self-host a Git service like Gitea specifically to keep source code, build pipelines, and often proprietary intellectual property off a third-party cloud platform. That same self-hosted posture means a vulnerable Gitea instance is frequently sitting closer to the crown jewels, application source code, CI/CD credentials, deployment secrets, than a typical internet-facing web application would be. A code injection flaw that lets an attacker run commands as the Gitea service account on that host is not a cosmetic bug in an admin panel; it is a foothold directly inside the software supply chain.
The severity here comes from how little an attacker needs to start. CVE-2026-60004 is documented as requiring only repository write access, and Gitea's own default configuration hands that write access to anyone who registers an account, a two-minute task on an instance that has not disabled self-registration. Submit one crafted patch to the diffpatch endpoint, submit it a second time, and the target Gitea host writes and executes an attacker-controlled file from inside Git's hook directory. CVSS scores this at 9.8, and the active exploitation CISA confirmed shows that score is not theoretical.
Treat any internet-reachable Gitea instance as a priority asset until you have confirmed both its version and its self-registration setting. If your organization already tracks CISA KEV entries against its own asset inventory, this is a direct candidate for that workflow; see our guide on cross-referencing asset inventory against the CISA KEV catalog if that process is not already in place. Teams that also run GitHub or GitLab alongside a self-hosted Gitea instance should use this disclosure as a prompt to review hardening across the whole Git estate, not just the one platform named in the CVE; our GitHub organization security hardening checklist covers the equivalent access-control settings worth auditing on that platform.
Affected Products
CVE-2026-60004 affects Gitea, the self-hosted Git service and lightweight alternative to GitHub or GitLab. The vulnerability is tracked as a code injection flaw (CWE-94) in the diffpatch API endpoint, carrying a CVSS score of 9.8. According to reporting corroborated across multiple independent write-ups, the flaw is present in Gitea versions from 1.17 through 1.27.0.
Gitea fixed the issue in version 1.27.1, released July 27, 2026, with a security advisory published the following day. Our own research did not directly pull the exact commit or the full version matrix from Gitea's own GHSA advisory page, so treat the 1.17 through 1.27.0 range cited above as the starting point for your own audit rather than the final word. Confirm your specific prior version against Gitea's own release notes and security advisory before assuming an update from any version in that range to 1.27.1 fully closes the gap.
If your environment runs any Gitea instance on a version earlier than 1.27.1, treat it as vulnerable regardless of whether self-registration currently appears disabled, since the correct combination of write access and diffpatch access can also come from a compromised legitimate account rather than a freshly self-registered one.
Briefings like this, every morning before 9am.
Threat intel, active CVEs, and campaign alerts, distilled for practitioners. 50,000+ subscribers. No noise.
Exploitation Status: Confirmed and Added to CISA's KEV Catalog
Exploitation of CVE-2026-60004 is confirmed, not theoretical. CISA added the CVE to its Known Exploited Vulnerabilities catalog on August 25, 2026, an action CISA takes only against its own confirmed-exploitation standard, and set a remediation deadline of August 28, 2026 for federal civilian executive branch agencies under Binding Operational Directive 26-04, a three-day window that signals how urgently CISA weighed the real-world risk. NVD carries a corresponding entry for the CVE.
Reporting from The Hacker News points to at least one concrete incident: an administrator described, in a post to the Russian collaborative blog Habr, that their self-hosted Gitea instance was compromised through this vulnerability and used to run crypto-mining software, consistent with the "miner-like payload" language used in that coverage. That is a real, described incident, but it is a single account from a single affected party rather than a broadly attributed campaign, and our data does not tie it or any other exploitation activity to a named threat actor or intrusion set.
Separately, Shadowserver's internet-wide scanning found approximately 8,393 Gitea instances still vulnerable and exposed to the internet as of around August 27, 2026, which is a measure of unpatched exposure rather than a count of confirmed compromises. Both figures matter for different reasons: the KEV listing and the Habr-reported incident confirm exploitation is real, while the Shadowserver count shows how much of the remaining internet-facing attack surface has not yet closed the gap.
Detection: What to Look For
Detection for this vulnerability centers on two behavior categories: abnormal use of the diffpatch endpoint itself, and file writes or process spawns originating from Gitea's Git hook directory rather than a normal deployment or CI process. Our platform maintains a detection rule covering the diffpatch exploitation pattern behind CVE-2026-60004, translated into vendor-specific variants for Splunk, Elastic, Microsoft Sentinel and Defender, CrowdStrike, SentinelOne, Cortex XDR, QRadar, and Chronicle, alongside the underlying Sigma rule.
If your organization runs Gitea and forwards its application and host logs into a SIEM, prioritize repeated diffpatch API calls from the same account or session in a short window, since the exploit chain requires submitting the malicious patch twice, and any file creation event inside a Git repository's hooks directory that was not produced by your own deployment tooling. Host-level process monitoring that flags the Gitea service process spawning an unexpected child process is a closer proxy for successful exploitation than API-layer logging alone. Teams evaluating where to route this kind of detection content, or standing up a SIEM for the first time specifically because a self-hosted Git platform now needs its own log pipeline, may find it useful to review hardening across the broader source-code hosting estate; our guide on detecting supply chain compromise in software build pipeline security covers the adjacent build-and-release telemetry worth collecting alongside Gitea's own logs.
Retrospective hunt queries covering both the repeated diffpatch call pattern and historical Git hook directory writes are also available across the same vendor set, for teams that want to sweep back through existing logs to rule out prior exploitation rather than rely solely on a forward-looking alert.
Subscribe to unlock Sigma Detection Rules
Free subscribers unlock full IOC lists, Sigma detection rules, remediation steps, and every daily briefing.
Subscribe to unlock Sigma Hunt Queries
Free subscribers unlock full IOC lists, Sigma detection rules, remediation steps, and every daily briefing.
Validation: Confirm Exposure and Patch Status
Work through the following before deciding whether this is a routine patch item or something that needs incident response attention in your environment.
Inventory every Gitea instance in your environment
Identify all Gitea deployments, including any instance stood up informally by an individual team, contractor, or business unit that central IT does not directly administer.
Check the current version against 1.27.1
Confirm each instance runs Gitea 1.27.1 or later. If any instance falls in the 1.17 through 1.27.0 range reported as affected, or you cannot confirm its exact version, treat it as vulnerable until proven otherwise.
Confirm whether self-registration is enabled
Check each instance's configuration for open self-registration. An instance with self-registration enabled and internet exposure should be treated as reachable by an unauthenticated attacker in practice, regardless of the CVE's technical authentication requirement.
Determine internet exposure of each instance
Identify whether each Gitea instance is reachable from the public internet, from a broader internal network segment than necessary, or only from a tightly scoped administrative network.
Review diffpatch endpoint access logs
Search application logs for repeated calls to the diffpatch API endpoint from the same account or session in a short window, which is consistent with the two-submission pattern this exploit requires.
Inspect Git hook directories for unexpected files
Check the hooks directory of repositories on each instance for executable files that your own deployment or CI tooling did not create, particularly on any instance with an older, unconfirmed patch status.
Mitigation: Step-by-Step Remediation
CISA's standard KEV guidance applies directly here: apply the vendor's fix, follow the risk-based prioritization described in Binding Operational Directive 26-04, evaluate internet exposure of every affected instance individually, and take an instance offline if it cannot be patched or otherwise mitigated while remaining internet-facing.
Subscribe to unlock WAF Detection Rules
Free subscribers unlock full IOC lists, Sigma detection rules, remediation steps, and every daily briefing.
Update to Gitea 1.27.1 or later
Apply the patched release Gitea shipped on July 27, 2026, and confirm the running version directly on each host rather than relying on a change ticket alone.
Disable self-registration unless it is operationally required
Turn off open self-registration on every Gitea instance that does not have a specific business reason to accept unvetted signups, closing the path that lets an outside visitor reach the vulnerable diffpatch endpoint in the first place.
Restrict repository write access to trusted accounts
Review who holds write access on every repository, since write access, not administrative access, is the technical bar for reaching the vulnerable code path.
Apply WAF or reverse-proxy controls where full patching is delayed
Platform-maintained WAF rule content covering this threat exists across ModSecurity, Cloudflare, AWS, and Azure for teams that need an interim compensating control in front of an instance awaiting a maintenance window; treat any such rule as a stopgap, not a substitute for the vendor patch.
Review logs and hook directories for signs of prior compromise
Work through the diffpatch access log and Git hook directory checks from the validation section above for the period since early July 2026, and escalate to incident response if you find a match rather than treating a version update alone as sufficient. Our guide on [responding to exposed credentials in Git incidents](/blog/exposed-credentials-git-incident-response) covers the follow-on secret-rotation steps relevant if a compromised Gitea instance held CI/CD or deployment credentials.
Take internet-exposed, unpatchable instances offline
Following CISA's standard KEV guidance, an internet-facing Gitea instance that cannot be patched or otherwise mitigated should be removed from public exposure rather than left reachable.
Known Limitations: What This Article Cannot Confirm
The most consequential gap in our data is attribution and the scope of exploitation. CISA's KEV listing and Shadowserver's exposure scan both confirm this vulnerability is real and being actively exploited, and The Hacker News reported one specific incident involving crypto-mining deployment, described secondhand through a Habr blog post from the affected party. Beyond that single account, our data does not identify a named threat actor, intrusion set, or a broader count of confirmed victim organizations. Next step: monitor CISA's KEV catalog entry and reputable incident response reporting for updates, and treat any broader attribution or victim-count claim you encounter elsewhere with skepticism until a named vendor, CISA, or an incident response firm confirms it directly.
Second, our data does not include a full public technical writeup or proof-of-concept walking through the exact diffpatch request sequence, only the general mechanism described by Gitea's own advisory and secondary reporting: a malicious patch submitted twice results in an executable written to and run from Git's hook directory. The detection and hunt guidance above is built from that behavior-level description rather than a vendor-verified signature matched against a captured exploit sample. Next step: use the log review categories above as a starting hypothesis and tune thresholds against your own environment's normal Gitea traffic before treating any single alert as a clean confirmation.
Third, the affected version range of 1.17 through 1.27.0 comes from secondary reporting rather than our own direct read of Gitea's official GHSA advisory or changelog. Next step: confirm your exact prior version and the precise patched build against Gitea's own security advisory and release notes before closing out remediation, rather than relying solely on the range cited in this article.
Finally, the Shadowserver figure of roughly 8,393 vulnerable exposed instances is a point-in-time snapshot from around August 27, 2026, and internet exposure changes daily as organizations patch or take instances offline. Next step: treat that number as a general indicator of how much exposure remained shortly after KEV listing, not as a live count, and rely on your own asset inventory and scanning to determine your organization's current status.
The bottom line
CVE-2026-60004 (CVSS 9.8) lets a user with repository write access on Gitea plant a Git hook through the diffpatch API and execute commands as the Gitea service account, and default open self-registration means an outside visitor can typically create that write access themselves. CISA added it to the KEV catalog on August 25, 2026 and gave federal agencies three days to remediate. Gitea fixed the flaw in version 1.27.1, released July 27, 2026. Confirm your version, check whether self-registration is disabled, and review diffpatch logs and Git hook directories for signs of prior exploitation before treating this as closed.
This analysis is generic. create a free account to score threats like this against your own stack.
Frequently asked questions
Is my organization affected by CVE-2026-60004?
You are affected if you run Gitea on any version earlier than 1.27.1, particularly if self-registration is enabled and the instance is reachable from an untrusted network, since that combination lets an outside visitor create the repository write access the exploit needs.
Has CVE-2026-60004 actually been exploited in the wild, or is this precautionary guidance?
It has been exploited. CISA added CVE-2026-60004 to its Known Exploited Vulnerabilities catalog on August 25, 2026 based on confirmed active exploitation, and at least one administrator has publicly described a Gitea instance compromised this way to run crypto-mining software.
What version of Gitea should I patch to?
Gitea fixed CVE-2026-60004 in version 1.27.1, released July 27, 2026. Confirm your exact prior version and the current patched build directly against Gitea's own security advisory and release notes before considering an instance remediated.
Do I need to be an authenticated Gitea user to exploit CVE-2026-60004?
Technically yes, the CVE record requires repository write access, but Gitea ships with self-registration enabled by default. On a default-configured instance, anyone can register an account and create a repository in minutes, making the practical exposure effectively the same as unauthenticated remote exploitation.
What is the CVSS score for CVE-2026-60004 and why is it rated critical?
CVE-2026-60004 carries a CVSS score of 9.8. It is rated critical because a low-privilege repository write action can be turned into arbitrary command execution as the Gitea service account, and default self-registration removes most of the practical barrier to reaching that write access.
Has a specific threat actor been attributed to exploitation of CVE-2026-60004?
No named threat actor, intrusion set, or ransomware operation appears in our data as being behind exploitation of CVE-2026-60004. One administrator publicly described a compromise involving crypto-mining software, but that is a single reported incident, not a broadly attributed campaign.
Sources & references
- BleepingComputer: Hackers now exploit critical Gitea flaw in code injection attacks
- BleepingComputer: Over 8,300 Gitea servers vulnerable to code execution attacks
- Cloud Security Alliance: Gitea RCE Under Active Exploitation: CVE-2026-60004
- Security Arsenal: CVE-2026-60004 Gitea diffpatch Code Injection Added to CISA KEV, Detection and Remediation Guide
- CISA: Adds One Known Exploited Vulnerability to Catalog (August 25, 2026)
- NVD: CVE-2026-60004 Detail
- The Hacker News: Critical Gitea RCE Actively Exploited as Reported Attack Drops Miner-Like Payload
Free resources
Critical CVE Reference Card 2025–2026
25 actively exploited vulnerabilities with CVSS scores, exploit status, and patch availability. Print it, pin it, share it with your SOC team.
Ransomware Incident Response Playbook
Step-by-step 24-hour IR checklist covering detection, containment, eradication, and recovery. Built for SOC teams, IR leads, and CISOs.
Get threat intel before your inbox does.
50,000+ security professionals read Decryption Digest for early warnings on zero-days, ransomware, and nation-state campaigns. Free, daily, no spam.
Unsubscribe anytime. We never sell your data.

Founder & Cybersecurity Evangelist, Decryption Digest
Cybersecurity professional with expertise in threat intelligence, vulnerability research, and enterprise security. Covers zero-days, ransomware, and nation-state operations for 50,000+ security professionals every morning.
