# Gitea Is Being Actively Exploited — and Your CI/CD Pipeline Is the Target


Two Gitea vulnerabilities in two months. The second one just landed on CISA's Known Exploited Vulnerabilities list. If you're running self-hosted Gitea and haven't patched to 1.27.1, someone may already be inside your build pipeline.


CISA confirmed Tuesday that CVE-2026-60004 — a code injection flaw in Gitea's diffpatch API — is being exploited in the wild. Federal agencies have until August 28 to patch. Everyone else should treat that deadline as theirs too.


## What the Exploit Actually Does


The mechanics here are worth understanding, because they're more insidious than a typical RCE.


An attacker who already has repository write access — a contributor, a compromised developer account, even a malicious pull request from an external collaborator — can send a specially crafted patch to Gitea's diffpatch API endpoint. That patch plants an executable Git hook on the server. From that point, shell commands run as the Gitea service account every time a matching Git operation fires.


Git hooks are the automation layer most developers trust implicitly. Pre-receive hooks, post-receive hooks, update hooks — they're designed to run code on repository events. Most security tooling doesn't scrutinize them the way it would a suspicious binary or a new cron job. A malicious hook blends in. It executes quietly and repeatedly, triggered by ordinary developer activity.


The Gitea service account is also typically more privileged than it needs to be. In many self-hosted deployments, it has read access to other repositories on the instance, access to configured CI/CD credentials, and potentially network-level reach into internal systems. Planting a hook isn't just a foothold — it's a machine that keeps working every time someone pushes code.


## "Write Access Required" Is Not the Comfort It Sounds Like


The conventional read on "requires repository write access" is that this vulnerability is limited in scope. That reading is wrong.


Consider who actually has write access to a typical Gitea instance: full-time engineers, contractors, open source contributors who've been granted access to submit patches, automated service accounts used by CI systems, and anyone whose credentials have been phished or leaked. The 2025 GitHub token exposure incidents demonstrated how routinely developer credentials end up in breach datasets. A threat actor who buys a batch of leaked dev credentials and finds a valid Gitea login has the exact access level this exploit needs.


For organizations with external contributor programs or open-source repos hosted on Gitea — common in government and enterprise contexts — the write-access bar is genuinely low.


## Two Gitea Vulns in Eight Weeks


This is not a coincidence.


CVE-2026-20896, a separate Gitea flaw, was flagged for exploitation in early July. CISA still hasn't added it to the KEV catalog — which is notable, because KEV inclusion typically signals confirmed, ongoing exploitation that warrants urgent action. Now CVE-2026-60004 is on the list, patched only last month, and already being weaponized.


The pattern is clear: someone is actively working through Gitea's attack surface. Whether it's the same threat actor, opportunistic copycats following July's disclosure, or nation-state groups probing developer infrastructure is unknown. CISA hasn't attributed the attacks, and there's no public technical writeup on who's behind the exploitation or what payload they're dropping after gaining access.


That ambiguity is its own signal. When attribution is unclear this early, it often means the targeting is broad — these aren't surgical attacks against specific named organizations. They're sweeps.


## Why Developer Infrastructure Is the Tier-One Target Right Now


The software supply chain has been in attackers' crosshairs since SolarWinds, and the targeting has only become more systematic. Self-hosted platforms like Gitea represent a particularly attractive attack surface: they hold source code and build configuration, they're often maintained by smaller teams with lighter security budgets than enterprise SaaS alternatives, and they're trusted implicitly by the developers who use them.


A compromised Gitea instance can yield:


  • Source code for unreleased products and internal tooling
  • Hardcoded credentials — API keys, database passwords, cloud tokens embedded in config files or commit history
  • CI/CD pipeline access — the ability to inject malicious steps into automated builds that ship to production
  • Lateral movement into internal networks, since Gitea servers typically sit on the same network segment as development infrastructure

  • The Git hook vector is particularly well-suited to persistent access. Unlike a webshell or a scheduled task, a malicious hook is embedded in repository configuration and survives server restarts, redeployments, and even some incident response procedures if responders don't know to look there.


    ## What to Do Right Now


    The patch is straightforward: upgrade to Gitea 1.27.1. That's the floor.


    Beyond the immediate patch, the exploitation pattern here suggests defenders should run a few additional checks:


    Audit Git hooks on every repository. Look for hooks you didn't put there. Pay particular attention to pre-receive and post-receive hooks on repositories with external contributor access.


    Review service account permissions. The Gitea service account should have the minimum access it needs. If it has credentials to external systems or broad network access, now is the time to scope that down.


    Check for unusual API activity. The diffpatch endpoint is the attack vector — if you have API logging, look for unexpected calls to it, particularly from accounts or IPs that don't match normal usage patterns.


    Rotate credentials stored in repositories. If there's any chance your Gitea instance was exposed between July (when 1.27.1 was released) and now, treat every credential in your repos as potentially compromised.


    ---


    ## HackWire Analysis


    Two things about this vulnerability cluster deserve more attention than they're getting.


    First, the KEV gap: CVE-2026-20896 from early July still isn't in CISA's catalog, even though exploitation was confirmed at the time. That inconsistency matters for organizations that use KEV as their primary patching priority signal — they may have deprioritized July's Gitea flaw precisely because it didn't get the official stamp. If you're in that camp, patch both.


    Second, and more importantly: the self-hosted developer tools category is systematically underdefended. Gitea, Forgejo, Gogs, and similar platforms are deployed by organizations that specifically chose not to use GitHub or GitLab Enterprise — often because they want data sovereignty or are operating in air-gapped or restricted environments. Those same organizations tend to have fewer dedicated security resources. Attackers clearly know this. The two-flaw-in-two-months pattern against Gitea looks less like a coincidence and more like someone working through a target list.


    The CI/CD pipeline has become the crown jewel that perimeter security used to protect. Exploiting a developer platform with write-access-level access, planting persistent hooks, and riding those hooks into production builds is a playbook that's going to keep paying dividends for threat actors. Gitea is today's example. It won't be the last.


    Defenders running any self-hosted development platform — not just Gitea — should treat this as a prompt to audit. When was the last time you looked at what's running in your Git hooks?


    — HackWire Editorial


    ---


    ## Related Coverage


  • Read more in our [Vulnerabilities](https://www.hackwire.news/category/vulnerabilities) coverage
  • Cross-reference with [Breaches](https://www.hackwire.news/category/breaches) and [Malware](https://www.hackwire.news/category/malware)
  • Stay current via the [HackWire homepage](https://www.hackwire.news/)