A Poisoned .git Config Can Now Hijack Claude Code, Codex, and Cursor
Cybersecurity

A Poisoned .git Config Can Now Hijack Claude Code, Codex, and Cursor

Researchers found eight flaws that let a booby-trapped Git repository run attacker code the moment an AI coding agent opens it, before any trust prompt appears.

PublishedSeptember 4, 2026
Read time5 min read
Share

The flaw lives in the plumbing, not the model

GitSpawn, as researchers at Manifold Security named it, is not a prompt injection attack and it is not a jailbreak. It abuses core.fsmonitor, a legitimate Git configuration setting designed to speed up status checks on large repositories by running a background command that reports which files changed. AI coding agents call Git constantly to figure out what branch they are on and what files are dirty, and several of them execute that fsmonitor command without asking permission first, because the feature exists specifically to run automatically.

That is the whole exploit. A repository ships with a .git/config file containing a fsmonitor entry that points to attacker-controlled code instead of a real file-watching helper. The moment an agent opens the folder and runs its routine startup checks, the attacker's command executes with the developer's own privileges, outside whatever sandbox the vendor built and before any trust prompt has a chance to appear. Manifold's own framing is the sharpest summary available: the vulnerability sits in 'the ordinary plumbing underneath, the subprocess an agent spawns at session startup,' not in anything novel about the models themselves.

A cross-vendor problem, patched unevenly

Manifold disclosed eight related flaws on September 2, and the patch state across the AI coding tool market is genuinely uneven. Block's goose agent fixed its version in 1.44.0 and picked up CVE-2026-72718, rated 7.0 on CVSS. OpenAI treated it seriously enough to publish three separate CVEs for Codex the same day, including CVE-2026-19592, and Cursor also shipped a fix. Claude Code patched its primary startup path but Manifold flagged a secondary route through the 'claude ultrareview' command that was still exploitable at disclosure.

Four of the eight flaws had no patch available when the research went public: Hermes Agent, whose CVE-2026-71963 is still unverified, along with Qwen Code and Grok Build. That spread matters because it tells you this is a class of bug that shows up wherever a team wired an AI agent to Git without asking what a hostile repository could make that integration do, spanning startups and well-funded labs alike. Any procurement conversation about coding agents now needs a patch-status question attached to it alongside the usual feature comparison, because the vendors are clearly not all at the same maturity level on this.

Why the delivery mechanism narrows the real exposure

The attack does not work against a normal git clone of a public GitHub repository, because a standard clone rebuilds .git from the remote's object data and does not preserve an attacker's crafted config file verbatim. The exposure is specifically repositories that arrive with an intact .git directory already on disk: a zip file emailed to a contractor, a project copied off a USB drive at a conference, a folder synced through Dropbox or a shared drive, or a repository pulled from an internal archive rather than cloned fresh.

That narrows the blast radius but does not shrink it to a rounding error. Enterprises with contractor onboarding via file shares, internal code archives passed around outside version control, or engineers who routinely unzip vendor-supplied sample projects into their IDE are exactly the shops where this gets exploited. The fix is procedural as much as technical: treat any repository that did not come from a fresh clone as untrusted input to an AI agent, the same way you would treat an unsolicited executable attachment.

What this means for how you scope agent autonomy

The uncomfortable part of GitSpawn for engineering leaders is that it exploited exactly the convenience feature that makes these agents useful in the first place: running Git commands automatically so the developer does not have to babysit every status check. Every vendor that wants agents to feel fast and autonomous has to make the same tradeoff, and GitSpawn is proof that several of them made it without a security review of what 'automatic' actually authorizes.

If you are past the pilot stage with AI coding agents, this is the moment to ask each vendor a specific question: which subprocess calls happen before the user grants any trust decision, and what runs with full developer privilege versus inside an isolated sandbox. A vendor that cannot answer that precisely, or whose answer is 'we trust the model to behave,' is not ready for a codebase with real IP or customer data in it. This is a governance question, not a model-capability question, and it belongs on the same checklist as SSO and audit logging.

The decision this puts on your desk

Practically, three things belong in your next engineering security review. First, inventory which AI coding agents are actually installed across your fleet, including ones individual engineers adopted without a procurement ticket, because Qwen Code and Grok Build usage often flies under the radar of official tooling lists. Second, set a policy that repositories arriving outside a fresh git clone, from archives, drives, or shared folders, get scrubbed of their .git directory or reviewed before an agent ever opens them.

Third, push your AI tooling vendors for a written patch commitment and a real sandboxing architecture rather than a blog post promising a fix is coming. GitSpawn will not be the last flaw found in the startup plumbing of these tools, because the entire category is less than three years old and is still being threat-modeled in public, one disclosure at a time. Budgeting for that ongoing patch cadence, and building the internal muscle to act on it fast, is now part of what it costs to run AI coding tools at scale rather than a footnote.

Tagged#news#security#cybersecurity#breach#cisa#ransomware#zero-day#supply-chain#ai-security#gitspawn#ai-coding-agents#claude-code#codex#cursor#manifold-security#developer-tooling