All articles
IT & Cybersecurity· 3 min read

GitSpawn: A Git config file runs code in Claude Code, Codex and Cursor

Manifold Security reports that a prepared repository can start any program as soon as an AI coding agent runs a routine git status, before any approval prompt. Several agents are patched, but Qwen Code, Grok Build, Hermes Agent and a second path in Claude Code reportedly remain open.

Key points

  • A core.fsmonitor entry in a repository's .git/config can run a program as soon as an agent calls git status.
  • The code runs outside the sandbox and before any approval prompt.
  • Normal git clone does not copy .git/config; the risk comes from zips, shared drives and sync folders.
  • Claude Code 2.1.196, Cursor, Codex and Goose 1.44.0 are fixed; Qwen Code, Grok Build, Hermes Agent and a Claude Code ultrareview path reportedly are not.
  • Countermeasures: review .git/config, call Git with core.fsmonitor=false, isolate untrusted code.

A repository can carry its own Git configuration, and several AI coding agents have run whatever program that configuration names, without asking the user first. Manifold Security calls the technique GitSpawn and reports that it worked against seven agents: Claude Code, OpenAI Codex, Cursor, Goose, Hermes Agent, Qwen Code and Grok Build [1]. This summary is based on a developer blog that draws on Manifold's disclosure and on a roundup by Adversa AI. The blog's author says they did not reproduce the exploits themselves [1].

How the attack works

Git allows certain settings to point to external programs. One of them is `core.fsmonitor`, a performance option: it names a helper that tells Git which files have changed whenever the index is refreshed [1]. Coding agents constantly collect context about a project, and to do that they call commands such as `git status` or `git diff` in the background. Those calls refresh the index [1]. If the `.git/config` inside the repository sets `core.fsmonitor` to a malicious program, Git launches it with the rights of the logged-in user [1].

The timing is what makes this serious. According to the source, the program runs outside the agent's sandbox and before any approval dialog appears, because agents do not treat a status query as something that needs the user's consent [1].

There is a limit. A normal `git clone` does not transfer `.git/config`, so the attack only works if the repository arrives with its `.git` directory intact, for example as a zip archive, on a network share, through a sync folder or on a USB drive [1]. The blog notes that this is less unusual than it sounds: code attached to a support ticket or sent as a take-home task in a hiring process often arrives exactly this way [1].

Patch status

Based on the table attributed to Manifold [1]:

  • Fixed: Claude Code in version 2.1.196 (reported 26 June 2026), Cursor, Goose in 1.44.0 (CVE-2026-72718) and OpenAI Codex.
  • Open: Qwen Code (accepted by Alibaba's security response centre, but not yet fixed), Grok Build, and Hermes Agent (CVE-2026-71963). For Hermes, Manifold says six attempts to reach the maintainers produced no triage.
  • Partly open in Claude Code: a second route through the ultrareview function relies on a different config key, which Manifold is withholding until it is fixed. Anthropic classified this report as a duplicate of an internal ticket [1].

The source does not say whether or when the open items will be fixed.

What to do now

For vendors, Manifold proposes a one-line fix: add `-c core.fsmonitor=false` to every Git call the agent makes in the background [1]. Teams that build their own agents or scripts around Git can apply the same setting.

For users, the source recommends the following [1]:

  • Before an agent opens a folder of unknown origin, read its local Git settings, for instance with `git config --list --local`. Any setting that names a program can execute it.
  • Handle a zip archive that contains a `.git` directory as you would an executable file, or delete `.git` and initialise the repository from scratch.
  • Update agents to at least the fixed versions, including the versions pinned in CI images.
  • Open unfamiliar code only in a throwaway VM or container.

Context

GitSpawn is one of several findings published within a few weeks. In each case the attack did not target the model but the tooling around it: Git configuration, plugin updates and subagent files defined inside repositories [1]. The blog concludes that, for now, loading a repository into a coding agent should be treated like executing its code [1]. With three agents still unpatched and an unresolved path in Claude Code, that is a sensible working assumption.

Sources

  1. [1]AI Coding Agent Security 2026: GitSpawn and Plugin4Shell · thevibelog.dev · 4 October 2026

Written with AI from the sources above and checked by our team.

Available experts in this field

See available experts →

Open searches in this field

See skills wanted →

Your skills are not listed?

Upload your CV once. We match you with every new project in your field and tell you why it fits.

Upload your CV