GitSpawn: A Booby-Trapped Repo Can Run Code the Moment Claude Code, Cursor or Codex Opens It
Disclosed on September 1, 2026 by Manifold Security, GitSpawn lets a booby-trapped repository run attacker code the instant it's opened with an AI coding agent — no prompt typed, no approval clicked, sometimes before you've even authenticated. Seven agents were affected, including Claude Code, Cursor and Codex. Four fixes have shipped. Four issues have not.
Key takeaways
- GitSpawn abuses git's
core.fsmonitorsetting, a performance option that lets a repository specify a helper command git runs automatically whenever its index refreshes — which happens on routine background commands likegit statusorgit diff. - Every AI coding agent Manifold examined runs those commands silently on startup to gather project context for the model, before the user types anything — which means the malicious command fires without any interaction at all.
- It doesn't spread through normal git operations.
git clone,fetch, andpulldon't transfer a repo's local.git/config, so the payload has to arrive as raw files — a ZIP, a shared drive, a USB stick, a handoff from a contractor — with the hidden.gitdirectory intact. - Eight issues, seven agents, four still unpatched at publication: Goose, Codex, Cursor and Claude Code's
core.fsmonitorpath are fixed. Hermes Agent, Qwen Code, Grok Build, and a separate flaw in Claude Code'sultrareviewcommand are not. - This isn't a novel bug class. VS Code shipped a fix for the same root pattern — code execution on opening a workspace — back in 2021. AI coding agents reintroduced it independently, at scale, by adding background git calls without sanitizing what a repo's own configuration can trigger.
How the exploit actually works
Almost every CLI-based coding agent gathers context the moment it starts up in a project directory — what branch you're on, what's changed, what's staged — by quietly running standard git commands in the background. That's a reasonable thing for an AI coding agent to do. The problem is what git itself is allowed to do in response.
core.fsmonitor is a legitimate git performance setting: instead of scanning the whole working tree for changes, git can delegate that to a helper program named in the setting, and trust its answer. That helper program is defined in the repository's own .git/config — which means whoever controls the repo controls what runs. Any command that refreshes git's index, including the background status and diff calls every agent runs automatically, executes it. No prompt has to be typed. No tool call has to be approved. In some configurations, this fires before the user has even authenticated with the agent.
The one mercy is distribution: standard git clone, fetch, and pull operations never transfer another repository's local .git/config, so GitSpawn can't propagate through ordinary git workflows. An attacker has to get the raw files — .git directory included — onto the target's machine some other way: a ZIP archive, a shared project folder, a synced cloud drive, a USB stick, or simply a colleague or contractor handing over "the project files" directly rather than a repo URL. All of those are routine, unremarkable ways developers actually receive code.
Which agents are affected — and which are still open
| Tool | Status | Detail |
|---|---|---|
| Goose | Fixed | CVE-2026-72718 (CVSS 7.0), resolved in 1.44.0 |
| OpenAI Codex | Fixed | Patched after report, tracked as duplicate of an independently filed finding |
| Cursor | Fixed | Patched after report, tracked as duplicate of an independently filed finding |
| Claude Code (core.fsmonitor path) | Fixed | Patched in 2.1.196; no public advisory issued |
| Claude Code (ultrareview command) | Unpatched | Separate flaw abusing a different git config key |
| Hermes Agent | Unpatched | CVE-2026-71963 — vendor unresponsive across six contact attempts |
| Qwen Code | Unpatched | Confirmed vulnerable in version 0.22.3 |
| Grok Build | Unpatched | Confirmed vulnerable in version 1.0.13 |
If your team uses any tool on the unpatched side of this table, treat repositories received outside a direct git clone as untrusted until you've manually checked .git/config for a core.fsmonitor entry — or an equivalent hook — before opening them in the agent.
Why your existing security program probably doesn't cover this
- It's not a vulnerability in your application code. Static analysis, dependency scanning, and code review all look at what a project's source does — not at what a developer's AI tooling does before a single line of that source is read.
- It's not covered by a standard AI agent review either. Most organisations scoping "AI agent security" mean the production agent talking to customers or internal systems — not the coding assistant running on an engineer's laptop with full filesystem and shell access.
- It lives at the exact seam most annual pentests skip. Source code review typically starts after checkout. AI agent testing typically starts after deployment. The moment in between — an untrusted repository landing on a developer's machine and being opened by a tool with execution rights — falls between both scopes.
- Developer machines are high-value, low-visibility targets. They hold SSH keys, cloud credentials, package registry tokens, and access to every repo the developer can reach — exactly the blast radius a supply-chain-style compromise is built to reach.
How ComplyArmor tests this attack surface
This falls at the intersection of two attack surfaces we already test: Source Code and AI Agents & LLM Applications, covered under our Smart PTaaS model of continuous testing rather than an annual snapshot. Findings map to LLM03:2025 Supply Chain Vulnerabilities in the OWASP Top 10 for LLM Applications — the same taxonomy referenced throughout this site.
- Agent startup behaviour audit. What commands does the coding agent run automatically on repo open, before any user interaction — and can those commands be redirected by the repository's own configuration?
- Trust boundary verification. Does the agent treat "a folder I was handed" the same as "a repo I explicitly cloned and reviewed" — the exact distinction GitSpawn relies on being absent?
- Tooling inventory across the engineering org. Which AI coding agents are actually in use, at what versions, and whether any sit on the unpatched side of a disclosure like this one — visibility most security teams don't currently have.
- Verified exploitation, not a version-number check. We reproduce the actual code execution path against a controlled target, the same standard we hold every engagement to, rather than flagging an outdated version and calling it done.
What to do this week
- Inventory which AI coding agents your engineers actually run. Adoption of these tools moves faster than most security reviews, so assume the list is longer than IT expects.
- Patch immediately on Goose, Codex, Cursor, and Claude Code's
core.fsmonitorpath. - Flag Hermes Agent, Qwen Code, and Grok Build as currently exposed and treat any repo not received via direct
git cloneas untrusted until inspected. - Set a policy for how developers receive code that isn't a clone — ZIPs, shared drives, and handoffs from external contractors are the realistic delivery path here, not phishing links.
- Treat this as a class of risk, not a single patch. The same root pattern was fixed in VS Code in 2021 and reappeared in seven unrelated tools in 2026 — the next reintroduction is a matter of when, not if.
Frequently asked questions
What is GitSpawn?
GitSpawn is a class of vulnerabilities, disclosed by Manifold Security on September 1, 2026, that lets a booby-trapped repository run attacker-controlled code the moment it's opened with an AI coding agent — before a prompt is typed, before approval is clicked, and in some cases before authentication. It works by abusing git's core.fsmonitor setting, which every AI coding agent examined triggers automatically while gathering project context in the background.
Which AI coding agents are affected by GitSpawn?
Manifold Security documented eight issues across Claude Code, OpenAI Codex, Cursor, Grok Build, Goose, Hermes Agent and Qwen Code. Four have been fixed: Goose (CVE-2026-72718, fixed in 1.44.0), Codex, Cursor, and Claude Code's core.fsmonitor path (patched in 2.1.196). Four remained unpatched at publication, including Hermes Agent (CVE-2026-71963, vendor unresponsive across six contact attempts), Qwen Code 0.22.3, Grok Build 1.0.13, and a separate flaw in Claude Code's ultrareview command that abuses a different git config key entirely.
Can GitSpawn spread through a normal git clone?
No. Standard git clone, fetch, and pull operations don't transfer another repository's local .git/config file, so the vulnerability can't ride in through ordinary git workflows. Attackers need to distribute the repository as raw files while preserving the hidden .git directory — which makes shared project folders, ZIP archives, synced cloud drives, USB storage, and handoffs from a colleague or contractor the realistic delivery paths.
Is this actually a new kind of bug?
The underlying pattern isn't new — VS Code fixed a workspace-open code execution bug with the same root cause back in 2021. What's new is the blast radius: seven AI coding agents independently reintroduced it by running background git commands to gather project context for the model, without sanitizing the repository's own configuration first.
What should a developer do right now?
Patch immediately if you're on Goose, Codex, Cursor, or Claude Code (the core.fsmonitor path). If you use Hermes Agent, Qwen Code, or Grok Build, treat any repository received outside a direct git clone as untrusted until you've inspected .git/config for a core.fsmonitor entry. Never open an unfamiliar ZIP, shared folder, or synced directory containing a .git folder directly in an AI coding agent.
How would a pentest catch something like this?
This sits at the intersection of source code review and AI agent tooling — a scope most annual pentests don't cover because the vulnerability isn't in application code, it's in how the AI coding agent itself interacts with an untrusted repository. Testing it means auditing what commands the agent runs automatically on repo open, whether those commands can be redirected by repository-controlled configuration, and whether the trust boundary between "a folder I opened" and "code I asked to run" actually holds.
Four of these eight issues are still open. The safest assumption for any engineering org is that "opening a project" and "running untrusted code" are the same action now — and that's worth testing, not just patching around.