arrow_back All posts
AI Security

GitSpawn: A Booby-Trapped Repo Can Run Code the Moment Claude Code, Cursor or Codex Opens It

ComplyArmor Team · September 4, 2026 · 8 min read

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

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

ToolStatusDetail
GooseFixedCVE-2026-72718 (CVSS 7.0), resolved in 1.44.0
OpenAI CodexFixedPatched after report, tracked as duplicate of an independently filed finding
CursorFixedPatched after report, tracked as duplicate of an independently filed finding
Claude Code (core.fsmonitor path)FixedPatched in 2.1.196; no public advisory issued
Claude Code (ultrareview command)UnpatchedSeparate flaw abusing a different git config key
Hermes AgentUnpatchedCVE-2026-71963 — vendor unresponsive across six contact attempts
Qwen CodeUnpatchedConfirmed vulnerable in version 0.22.3
Grok BuildUnpatchedConfirmed 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

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.

What to do this week

  1. 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.
  2. Patch immediately on Goose, Codex, Cursor, and Claude Code's core.fsmonitor path.
  3. Flag Hermes Agent, Qwen Code, and Grok Build as currently exposed and treat any repo not received via direct git clone as untrusted until inspected.
  4. 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.
  5. 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.

arrow_back All posts Book a free source code exposure scoping call arrow_forward