Git config in a shared folder runs code in AI coding agents
In short
- Manifold Security, a security vendor, says several command-line AI coding agents run git commands as soon as they open a folder, and that a repository received as a folder (a shared .zip, for example) can use its own Git settings to make that command run the sender's code. The code runs as the developer, outside the agent's sandbox, with no approval prompt.
- The 1 September 2026 post lists eight findings across seven agents. Four were still unpatched on the day it was published. It names Claude Code, Goose, Hermes Agent, Qwen Code and Grok Build, and says Codex and Cursor were also affected and have since been patched.
8 findings across 7 agents; 4 still unpatched at publication; Over 77 million monthly npm downloads of Claude Code, per Manifold (npm API); 26 June 2026 Manifold's first report (Claude Code)
How can a Git setting run code in an AI coding agent?
A coding agent is a program that reads a project and edits or runs code on a developer's behalf, here from a terminal. To know where it is, it asks Git what branch is checked out and which files changed, using commands such as git status and git diff. Manifold's starting question was what these agents actually do when they start up.
Git keeps per-repository settings in a file, .git/config. One setting, core.fsmonitor, is meant to speed up large projects: instead of scanning every file, Git asks a helper program what changed, and it runs that program whenever it refreshes its index. Most commands that touch the working tree refresh it, so git status and git diff both do. If the repository's own config names a command there, Git runs it.
Manifold's point is that the agents ran these background calls without stripping the repository's config. The repository named a command, Git ran it, on the host, as the user. Manifold says the agent's own code starts that subprocess, so it sits outside the agent's sandbox and the permission model never sees it.
Why does "no click" matter?
Most agent attacks need the user to approve something, or need a prompt to carry hidden instructions. This one needs neither. Manifold says the command ran, depending on the agent, before the workspace-trust prompt was accepted, before the user had authenticated, or on the first keystroke of a prompt. An attacker who gets code running this way can reach, in Manifold's list, SSH keys, cloud credentials in the environment, tokens in shell config and every repository on the disk.
There is a limit. Manifold stresses that git clone, fetch and pull do not carry this: a hostile URL does nothing. The repository must arrive as files with its .git directory inside, so the route is anything that copies a folder instead of cloning it: a shared .zip, a shared drive, a sync folder, a USB stick. Manifold used a .zip for every proof of concept. It withheld a ready-made repository, and withheld the name of the setting behind one finding that is not core.fsmonitor while that finding is unpatched.
What did Manifold find in each agent?
Rows are ordered by report date by us; the Cursor and Codex rows give only what Manifold's table states. Manifold says the Codex variant works somewhat differently but is the same class, and that five of its reports came back as duplicates of findings others had already filed, one on the same day.
Case details from the post:
- Goose: goose review builds its diff with git diff, passing one config flag and stripping none, so the command ran before the model was contacted. Affected 1.41.0; the maintainers scored CVE-2026-72718 at 7.0.
- Claude Code, start-up: the git status run to gather context ran the command while the workspace-trust prompt was still waiting, on 2.1.193.
- Claude Code, ultrareview****: a different Git setting of the same kind; the command ran at start-up even before the trust prompt was shown.
- Qwen Code: git status at start-up, so the payload ran before the user had authenticated.
- Grok Build: the payload ran on the first keystroke of a prompt, before any message was sent.
- Hermes Agent: the payload ran when the first message was sent.
What should developers do?
Manifold's advice is short. If you receive a repository as files, read .git/config before opening the folder with an agent, because any setting that names a program can run it. If you build an agent, blank the setting on background Git calls, for example git -c core.fsmonitor=false status.
Since then
On 9 September 2026 the security firm grith (which sells agent-supervision software) published its own reproduction. On git 2.43.0 a folder carrying a core.fsmonitor command fired on a plain git status. It also fired with safe.bareRepository=explicit, the Git 2.38 setting from October 2022 that most commentary recommends; that setting covers bare repositories buried inside a working tree, a different delivery route. Only blanking core.fsmonitor on the call blocked it. grith also reports that Claude Code now carries both overrides in its binary, and, citing OpenAI's advisory as summarised by The Hacker News, that Codex CLI was fixed in 0.131.0 under CVE-2026-19592. We did not check those claims against the vendors.
What this does not tell us
All findings are Manifold's account, from a company that sells agent-monitoring products and ends its post with that pitch. We did not check any vendor's patch status, and the post's status column is as of 1 September 2026. The post says it found the flaw in more agents than it names, and does not give their count or names. It does not say how many users were exposed, and it reports no attack in the wild.
Terms in plain English
- Workspace-trust prompt: the question some agents ask on opening a folder, whether you trust its contents.
- Sandbox: a restricted environment meant to limit what code run by an agent can touch.
- Index refresh: Git re-checking which files changed before answering a command like git status.
- CVE: a public ID number for a specific security flaw.
Sources
- GitSpawn: A Single Flaw Lets Untrusted Repos Run Code in Claude Code, Codex, Cursor, and Grok, Manifold Security, 1 September 2026
- A Git Config Key Ran Code in Seven Coding Agents. The 2022 Fix Does Not Stop It, grith, 9 September 2026
Sources
- GitSpawn: A Single Flaw Lets Untrusted Repos Run Code in Claude Code, Codex, Cursor, and Grok
- A Git Config Key Ran Code in Seven Coding Agents. The 2022 Fix Does Not Stop It
Related stories
- Drupal installer flaw is exploited a day after its advisory
- Two PHP engine flaws allow remote code execution; fixed 21 Oct
- Cloudflare brings full post-quantum switch forward to 2027
- Anthropic says plain Claude Code review finds 11 of 21 logic bugs
- OpenSSL fixes Encrypted Client Hello bug allowing impersonation
- Anthropic posts quantum algorithms its authors call impractical
More from AI and Security
- Only 26% of AI security patches were clean fixes, 1Password says
- PortSwigger's Kettle says his AI invented new web attacks
- AISI: AI agent tried to push malicious code using fake identities
- Claude hacked 3 real firms in a 'sealed' test, Anthropic says
- Anthropic's Claude finds faster attack on post-quantum HAWK