GitSpawn Exposes Persistent Git Config Execution Risks in Coding Agents

Manifold Security released GitSpawn, detailing eight vulnerabilities across seven coding agents where opening a folder triggers arbitrary code execution via Git configuration before any user prompt. The core issue stems from the core.fsmonitor setting in .git/config, which Git executes during index updates like git status or git diff. While vendors including Anthropic patched Claude Code in version 2.1.196, the fix only blocks agent-initiated calls and leaves manual Git commands or other tools vulnerable. Additional vectors include nested bare repositories tracked under CVE-2026-45033 affecting GitHub Copilot CLI and unpatched agents such as Qwen Code and Grok Build. The researcher also released the Stroq tool to inspect repositories for dangerous settings like core.fsmonitor and postinstall scripts before opening them. The findings highlight that repository trust mechanisms from 2021 remain bypassed by modern AI coding tools.

HabrTranslated from Russian

Read at source

Manifold Security has published GitSpawn, a report uncovering eight vulnerabilities across seven coding agents that allow arbitrary code execution simply by opening a received folder.

The attack leverages Git's core.fsmonitor configuration key stored in .git/config. This setting defines a command that Git automatically runs during index refreshes triggered by operations such as git status or git diff. Coding agents invoke these commands in the background immediately after opening a directory to build context, executing the payload before any user approval or prompt.

The researcher demonstrated the exploit by setting core.fsmonitor to a malicious script and confirming execution with a single git status command. Payloads ran even in the absence of any explicit user action beyond opening the folder.

Partial Patches Leave Broader Risks

Vendors responded with targeted fixes. Claude Code closed the core.fsmonitor vector in version 2.1.196, and similar patches were applied to Codex, Cursor, and Goose. However, these mitigations only prevent the agent from invoking Git with dangerous configuration values. Manual execution of git status or integration with build scripts, editors, and CI systems still triggers the payload.

Additional issues compound the problem. Manifold Security reported a second bypass path in Claude Code that remained open on version 2.1.252. Agents including Qwen Code, Grok Build, and Hermes Agent stayed unpatched as of the report date. A separate vector involving nested bare repositories was assigned CVE-2026-45033 and affected GitHub Copilot CLI until version 1.0.43.

The class of vulnerability is not new. VS Code addressed similar risks in 2021 through workspace trust prompts, yet the arrival of autonomous coding agents effectively reset those protections.

Stroq Tool for Pre-Opening Inspection

To address the gap, the researcher released Stroq, an open-source Apache-2.0 tool that scans repositories for dangerous settings before they are accessed. The command checks .git/config for executable values, .gitattributes, .husky hooks, postinstall scripts, and nested bare repositories.

Environment variable overrides can also neutralize the vectors at runtime by forcing core.fsmonitor to false and disabling automatic bare repository discovery. The tool is intended for use in pre-commit hooks and CI pipelines.

Meridian digestThe week's most consequential security stories, distilled into one briefing.See the digest

More in Vulnerabilities & Exploits

Telegram for Android Patches Voice Call Vulnerability Enabling Code Execution
Yandex Patches Millions of Stations After eMudhra Certificate Keys Compromised
Cisco ASA and FTD Face DoS Vulnerability in SSL VPN Already Exploited in the Wild