A newly disclosed class of vulnerabilities, dubbed GitSpawn, can allow a booby-trapped software repository to silently execute code on a developer’s machine the moment it is opened with an AI coding agent.
The attack requires no prompt, approval click, or other user interaction. In some cases, the malicious command can run before a developer has authenticated to the coding platform.
Security researchers at Manifold Security discovered the issue while investigating what command-line AI coding agents automatically do when they start inside a project directory.
GitSpawn Flaws Let Malicious Repositories Execute Code
According to the Manifold Security technical disclosure, nearly every agent examined performs background Git commands, including git status and git diff, to collect project context before responding to a user. This behavior is ordinary and normally harmless, but it can trigger Git to refresh its internal index.
The risk comes from Git’s core.fsmonitor setting. The configuration option is intended to improve performance by allowing a repository to define a file-system-monitor helper program. Git can automatically launch that helper whenever it refreshes its index.
However, Git reads the core.fsmonitor value directly from the repository’s local .git/config file. An attacker can therefore place an arbitrary command in a malicious repository’s Git configuration.
When an AI coding agent opens the project and runs its routine background Git command, Git may execute that attacker-controlled helper.
The command executes with the privileges of the logged-in user and outside the AI agent’s sandbox. As a result, ordinary permission prompts, tool approval controls, and sandbox protections may not stop the malicious process.
The execution can also occur silently, before a developer types an instruction or understands that the repository contains hostile configuration.
GitSpawn is not delivered through ordinary git clone, git fetch, or git pull operations because those workflows do not transfer another repository’s local .git/config file. Instead, attackers need to distribute the repository as raw files while preserving the hidden .git directory.
This makes shared project folders, ZIP archives, synchronized cloud directories, USB storage, and direct handoffs from colleagues or contractors potential delivery paths.
A developer may believe they are simply opening a project for review, testing, or maintenance, while the AI coding tool triggers the malicious Git configuration in the background.
Francisco Rosales confirmed GitSpawn-style issues across Claude Code, Goose, Hermes Agent, Qwen Code, and Grok Build. Related variants also affected OpenAI Codex and Cursor.
Cursor and Codex reportedly issued patches after receiving vulnerability reports, although the findings were treated as duplicates of independently reported issues.
Four flaws reportedly remain unpatched, including a separate Claude Code issue in its ultrareview command. That flaw abuses a different Git configuration key rather than core.fsmonitor. Researchers withheld the exact key to avoid publishing an immediately reusable attacker template.
Goose has released a fix for its affected behavior and received CVE-2026-72718. Hermes Agent was assigned CVE-2026-71963 after its vendor reportedly failed to respond to six outreach attempts.
Claude Code remains especially significant because the tool has more than 77 million monthly npm downloads. Additional details on Claude Code issues are available in this vulnerability report.
Developers should inspect .git/config before opening repositories received as copied folders or archives.
AI coding vendors should sanitize repository-controlled Git settings during automated context collection and explicitly disable core.fsmonitor where possible to block this silent code-execution path.
Give your security team the visibility and context to investigate suspicious activity faster and contain threats before business impact grows. Strengthen Your Investigations with ANY.RUN