P.K. SHARMA

Cyber security intelligence, AI governance, practitioner analysis

Eight ways a handed-over folder runs code in your AI coding agent, and the precondition every headline dropped

Manifold Security's GitSpawn findings put the command execution before the workspace trust prompt in seven agents. Cloning is not affected, which is the half that did not travel.

By Parminder Kumar Sharma · · 7 min read

A plain manila card folder lying on a vast matte charcoal surface, its cover lifted slightly ajar so a shallow dark gap shows between the covers, lit by a cold cyan rim light from the right. The folder is entirely unlabelled.

Manifold Security published eight findings this week across seven command line AI coding agents. In each of them a repository supplies a git setting that names a program, the agent runs git in the background to work out what it is looking at, and the program runs.

No prompt is typed. No approval is clicked. In several cases it happens before the workspace trust dialogue appears at all.

The headline everywhere is that malicious repositories execute code in Claude Code, Codex, Cursor and Grok. The research says something narrower and more useful, and the narrower version is the one you can act on.

The precondition the coverage dropped

In Manifold's own words: "git never carries this. Cloning a hostile URL does nothing, and neither does fetch or pull."

The repository has to arrive as files, with its .git directory already inside. A zip. A shared drive. A synced folder. A USB stick. As they put it, colleagues pass projects around this way and consultants hand them to clients.

That is not a small caveat. It removes the entire drive-by case, which is what "malicious repositories execute code" implies to a reader who does not open the paper. It also tells you exactly which of your habits is the exposure, and for most teams it is the one nobody has a policy for.

Where the command runs, and where the prompt is

WHERE THE COMMAND RUNS, AND WHERE THE PROMPT ISTwo ways a repository reaches you. Only one of them runs anything.IF YOU CLONE ITgit clone, fetch or pullhowever hostile the URLNothing runsgit never carries the settingthis is the half the headlines dropIF IT ARRIVES AS FILES: A ZIP, A SHARED DRIVE, A SYNC FOLDER, A USB STICKIt arrives as files.git directory intactContext gatheringgit status --porcelain=2The index refreshescore.fsmonitor names itIt runs. As you.no sandbox, no promptall four of these happen before you are asked anythingTHE WORKSPACE TRUST BOUNDARYThe workspace trust promptthe control that was supposed to govern everything above itThe bug is not that the agent runs git. It is that it runs git before the boundary that governs it.
Five of the eight reports were closed as duplicates of independent submissions, several filed within days of each other. That is worth more than the individual findings: it is what a bug class looks like when it is the obvious consequence of a design everybody adopted at once.
Drawn from Manifold Security's description of the mechanism. The clone path is included because it is the half that keeps getting dropped: it dead ends, and nothing runs.

The setting

core.fsmonitor is a performance option for large repositories. Rather than checking every file on disk, git asks a helper program what changed, and runs that program during an index refresh. A repository can carry it in its own .git/config:

[core]
    fsmonitor = <command>

Nearly every agent examined gathers project context by running things like git status --porcelain=2 --branch or git diff --name-only HEAD. Those calls refresh the index. The index refresh reads the repository's config. The config names a command, and git runs it, on the host, with the user's privileges, outside whatever sandbox the agent maintains for the commands it decides to run itself.

The fix is one flag. Manifold's recommendation to vendors is to sanitise the config on background calls, for example git -c core.fsmonitor=false status.

What is patched and what is not

Eight findings, seven agents, four still open

AgentReportedStatus
Claude Code, core.fsmonitor26 JunePatched in 2.1.196. Closed as a duplicate of a same-day report
Cursor8 JulyPatched. Closed as a duplicate of an earlier report
Qwen Code7 JulyUnpatched at 0.22.3. Accepted by Alibaba SRC
Goose13 JulyPatched in 1.44.0. CVE-2026-72718
Grok Build14 JulyUnpatched at 1.0.13. Closed as informative, duplicate of a 1 July report
Claude Code, review path15 JulyUnpatched at 2.1.252. Closed as a duplicate of an internal ticket
Hermes Agent20 JulyUnpatched at 0.21.0. CVE-2026-71963. No triage after six contacts
OpenAI Codex20 JulyPatched. Closed as a duplicate of an earlier report
Reported between 26 June and 20 July 2026, retested by Manifold on 1 September 2026. Versions are the ones Manifold tested. Five of the eight were closed by vendors as duplicates of independent reports.

Two things in that table deserve more attention than the count.

The first is the second Claude Code finding. It is not core.fsmonitor. It is a different git setting of the same kind, on the review path, and Manifold has deliberately left it unnamed while it remains unpatched. That is a researcher choosing to be less quotable in order to be less useful to somebody else, and after a fortnight of single-source claims arriving with their caveats stripped, it is worth saying plainly.

The second is the duplicate column. Five of eight were closed as duplicates of reports that arrived independently, several within days. That is the more interesting result. It is not eight mistakes. It is one design decision, adopted across an industry inside a year, producing the same hole in seven products at once, and being found by several people simultaneously because it is what happens when an agent shells out to git.

What to actually do

Take this with you

Ordered by how much it buys you

  • Stop opening handed-over project folders with an agent as your first move. If a repository arrived as a zip, a drive share or a stick, run git config --local --list against it, or just open .git/config in an editor, before you point anything at it. Any setting that names a program can run it.
  • Check your agent versions against the table above. Claude Code 2.1.196 and later closes the core.fsmonitor path; the review path is still open at 2.1.252. Goose 1.44.0 closes CVE-2026-72718.
  • If you run Qwen Code, Grok Build or Hermes Agent, there is nothing to upgrade to yet. Treat every foreign repository as untrusted input and inspect the config first.
  • Re-clone instead of copying, where you can. git clone against the same source produces a directory without the attacker’s config, and Manifold is explicit that the wire protocol does not carry it.
  • If you build agent tooling, sanitise the config on the context calls your product makes without asking, for example git -c core.fsmonitor=false status. That is the whole fix.
  • Do not treat the workspace trust prompt as the boundary until you have checked when your agent shows it. In several of these the context gathering ran first.

The position

There is a version of this story where AI coding agents are reckless and this is the proof. That version does not survive contact with the research.

Reading a repository's git config is what git does. Running git status to understand a project is what a sensible tool does. The mistake is in the ordering, and the ordering was inherited: every one of these products decided independently that gathering context is cheap, safe and worth doing before the user has said anything, because for a human developer at a terminal it always was.

What changed is that the thing gathering context is now a program that starts on its own, in a directory the user has not looked at, at the moment the folder is opened. That is a different threat model wearing the same commands, and the trust prompt that everybody built stayed where it was.

The narrow lesson is a config check before you open somebody else's folder. The wider one is that when a tool starts doing a familiar thing autonomously, the controls around it are usually still positioned for the old cadence.

Sources

  1. PrimaryGitSpawn: A Single Flaw Lets Untrusted Repos Run Code in Claude Code, Codex, Cursor, and Grok. The mechanism, the agent table, the disclosure timeline and the retest of 1 September 2026Manifold Securityaccessed 2026-09-03
  2. Primarygit config documentation for core.fsmonitor, the hook-based index refresh setting the attack abuses, and the -c override used in the recommended mitigationGitaccessed 2026-09-03
  3. Reported byMalicious .git Configs Can Make Claude, Codex, Cursor, and Other AI Agents Run Attacker Code, 2 September 2026The Hacker Newsaccessed 2026-09-03

Share this briefing

Know someone who owns this problem? Send it to them.

Related briefings

The briefing, in your inbox

Practitioner analysis of cyber and AI security news. No vendor noise.

One email per briefing. Unsubscribe any time.