CVE-2026-60004 (CVSS 9.8): Gitea RCE Actively Exploited — Patch Your Self-Hosted Git Server Before Your Software Supply Chain Is Compromised
If your organisation self-hosts Gitea for source-code management, your entire software supply chain may already be compromised — and you might not know it yet. CVE-2026-60004, a CVSS 9.8 remote code execution flaw in Gitea’s diffpatch API, has been actively exploited since at least July 2026. CISA formally confirmed in-the-wild attacks on 25 August 2026 and gave federal agencies just three days to patch. Five thousand internet-exposed Gitea instances remain at undetermined patch status, with attackers automating exploitation in minutes using public proof-of-concept code.
- CVE-2026-60004 carries a CVSS score of 9.8 (Critical) and allows arbitrary OS command execution on any server running Gitea 1.17 through 1.27.0.
- Exploitation is effectively unauthenticated: with open self-registration (Gitea’s default), a threat actor can register a free account, create a repo, and trigger the shell within minutes.
- CISA added the flaw to its Known Exploited Vulnerabilities (KEV) catalog on 25 August 2026; the federal remediation deadline was 28 August 2026.
- Observed payloads include cryptocurrency miners and dropper stagers; the real danger is lateral movement into CI/CD pipelines, package registries, and private source repositories.
- ~5,000 Gitea instances are internet-accessible (Shadowserver), and open-source PoC exploit code is publicly available.
- The fix is available now: upgrade to Gitea 1.27.1 or later — released 27 July 2026.
What Is CVE-2026-60004 and Why Is It So Dangerous?
Gitea is a lightweight, self-hosted Git service popular with engineering teams in India and globally who want full control over their source code without paying for SaaS platforms. Its flexibility is also its risk: organisations that run Gitea on-premises are responsible for keeping it patched — and many have not.
The vulnerability lives in Gitea’s diffpatch API endpoint, which processes patch files against repositories. The root cause is deceptively simple: when Gitea applies a patch, it creates a bare temporary clone of the repository. Unlike a normal clone, a bare repository does execute Git hooks. An attacker who can write to a repository can craft a malicious patch that plants an executable hook file — and then trigger a Git operation that fires it, running arbitrary shell commands as the Gitea OS service account.
Gitea fixed the issue by changing the temporary clone from bare to non-bare (pull requests #38637 and #38638), so hooks can no longer be seeded via patch operations. The fix shipped silently in version 1.27.1 on 27 July 2026 — described under MISC in the release notes — with the security advisory following a day later on 28 July.
Attack Chain: From Patch Upload to Full OS Shell
What makes CVE-2026-60004 especially alarming is how frictionless exploitation is when Gitea runs with default settings. Here is the complete chain an attacker follows:
- Self-register an account. Gitea enables open registration by default, so no prior credentials are needed.
- Create a new repository. This grants immediate write access.
- Submit a malicious patch via
/api/v1/repos/{owner}/{repo}/diffpatch. The payload plants a pre-commit or post-receive hook in the bare temporary clone. - Trigger a Git event (e.g., a push or pull) that causes Gitea to execute the planted hook as its service account.
- Shell commands run on the host — miners, reverse shells, or data-exfil tools, all with the privileges of the Gitea process.
Public PoC code (first published around 12 August 2026) reduces this to a single script. Alibaba Cloud’s security team observed exploitation in the wild as early as July 2026, deploying cryptomining software. CISA’s 25 August KEV addition confirmed that attacks had broadened beyond opportunistic miners.
The Real Risk: Your Software Supply Chain
Cryptominer payloads are the obvious, visible indicator — but they are also the least dangerous outcome. Gitea often sits at the centre of an organisation’s software supply chain:
| Asset at Risk | Potential Impact |
|---|---|
| Private source repositories | Intellectual property theft, client code exposure |
| CI/CD pipelines (Jenkins, Woodpecker, Drone) | Injected malicious builds distributed to customers |
| Internal secrets and API keys in repo config | Credential harvesting, cloud account takeover |
| Package / artifact registries | Poisoned packages pushed to downstream users |
| Internal network reachable from Gitea host | Lateral movement to databases, AD, and production |
Indian IT services firms and product companies that host client code in self-managed Gitea instances face a particularly serious risk: a compromise could expose intellectual property belonging to multiple clients, triggering contractual and regulatory consequences under India’s Digital Personal Data Protection (DPDP) Act, 2023 and international frameworks such as GDPR or SOC 2 obligations.
For context on how adversaries pivot through supply-chain assets, see our earlier coverage of CVE-2026-82329: JFrog Artifactory Auth Bypass Exploited to Mint Admin Tokens — the pattern of targeting developer infrastructure is consistent and accelerating.
What You Should Do Right Now
Here is the prioritised action plan Sanjay recommends for enterprise teams running Gitea:
1. Patch First
Upgrade all Gitea instances to version 1.27.1 or later immediately. Check your deployment with gitea --version or the Gitea admin panel under Site Administration → Server Information. If containerised, pull the latest official image and redeploy. There is no workaround — upgrading is the only complete fix.
2. Disable Open Self-Registration
While you are patching, reduce your attack surface by disabling public account self-registration (Site Administration → Settings → Service → Disable Self-Registration). This does not eliminate the vulnerability for internally registered accounts, but it removes the easiest exploitation path for unauthenticated external actors.
3. Network-Layer Controls via FortiGate / Zero-Trust
A properly segmented zero-trust network limits the blast radius if an attacker obtains a shell on the Gitea host. Recommendations:
- Restrict inbound access to the Gitea API (
/api/v1/*) to known internal IP ranges or VPN users using FortiGate firewall policies — do not expose the API surface to the internet. - Apply deep-packet inspection on outbound connections from the Gitea server. Cryptominer C2 traffic and reverse shell beaconing are detectable via SSL inspection and IPS signatures.
- Ensure micro-segmentation prevents the Gitea host from reaching production databases, Active Directory, or cloud management APIs directly.
- If you use FortiGate SD-WAN, verify that application control policies classify and restrict Gitea API traffic appropriately.
4. Hunt for Indicators of Compromise
If your Gitea ran an unpatched version between 1.17 and 1.27.0, assume breach until proven otherwise. Hunt for:
- Unexpected Git hooks in any repository’s
.git/hooks/directory — especiallypre-receive,post-receive, orpre-commitfiles with executable bit set and shell content. - Anomalous processes spawned by the Gitea service account (e.g.,
curl,wget,bash -i,python, cryptocurrency miners). - Unusual
diffpatchAPI calls in Gitea’s access logs — look forPOST /api/v1/repos/*/diffpatchfrom unfamiliar IPs or newly registered accounts. - High CPU / outbound bandwidth from the Gitea host, often the first sign of a miner payload.
- New or modified repository hooks in the Gitea data directory (
gitea-repositories/{owner}/{repo}.git/hooks/).
Your SOC should create detection rules for these patterns in your SIEM. SOC Prime has published detection content for CVE-2026-60004 that can be deployed across major SIEM platforms.
5. Audit CI/CD for Tampering
If the Gitea host had CI/CD system access, audit recent build artefacts and pipeline configurations for injected commands or modified dependency manifests. Treat any build produced during the exposure window as potentially compromised.
Frequently Asked Questions
Does this affect GitHub, GitLab, or Bitbucket?
No. CVE-2026-60004 is specific to Gitea — the self-hosted open-source Git platform. Hosted services (GitHub.com, GitLab.com, Atlassian Bitbucket Cloud) have entirely different codebases and are not affected. Self-hosted GitLab and Bitbucket Data Center are also different products and are not impacted by this specific flaw.
We disabled self-registration — are we safe without patching?
Disabling self-registration raises the bar significantly for external attackers, but it does not eliminate the vulnerability. Any user with a valid Gitea account and repository write access — including disgruntled employees, compromised credentials, or service accounts — can still exploit the flaw. Upgrading to 1.27.1 is the only complete remediation.
How quickly can an attacker exploit this once they have write access?
Exploitation is fully scriptable and can complete in under 60 seconds. Public PoC code automates account creation, repository setup, patch submission, and hook triggering in a single run. This is not a theoretical risk — CISA confirmed active exploitation, and Alibaba Cloud observed real attacks beginning in July 2026.
Are there any CISA resources or NVD links I can share with my management?
Yes. Refer your leadership to the official CISA KEV advisory (August 25, 2026), the SecurityWeek analysis, and the official Gitea 1.27.1 release notes confirming the patch. These authoritative sources make the business case for emergency patching unambiguous.
The Bottom Line: Patch Today, Audit Yesterday
CVE-2026-60004 is a textbook example of why developer-facing infrastructure demands the same security rigour as production systems. Gitea sits at the root of your software supply chain — compromise it, and an attacker owns everything that flows through it: source code, credentials, build artefacts, and the trust your customers place in the software you ship.
CISA’s three-day patch window for federal agencies was not hyperbole. It reflected the real-world speed at which public PoC code turns a disclosure into mass exploitation. If your organisation is still running Gitea 1.27.0 or earlier, every hour you delay is an hour of unnecessary exposure.
Upgrade to Gitea 1.27.1 now. Disable open self-registration. Segment your Gitea server from sensitive internal networks. Hunt for existing compromise. And review your entire DevSecOps pipeline for signs of tampering.
Need help assessing your organisation’s exposure or hardening your developer infrastructure against supply-chain attacks? Book a security assessment with Sanjay Seth — a cybersecurity consultant with deep expertise in zero-trust architecture, FortiGate network security, and enterprise NOC/SOC operations across Delhi NCR and beyond.