Cyber Security News

GitSpawn Flaws Let Malicious Repositories Execute Code in Claude Code, Codex, Cursor, and Grok

A newly disclosed class of vulnerabilities, dubbed GitSpawn, allows a booby-trapped repository to silently execute code on a developer’s machine the moment it is opened with an AI coding agent, no prompt typed, no approval clicked, and in some cases before the user has even authenticated.

Security researchers at Manifold Security found the flaw while investigating what CLI-based coding agents actually do on startup, as detailed in the technical disclosure published by Manifold Security.

Nearly every agent they examined gathers project context by quietly running git commands like git status or git diff in the background. That behavior is unremarkable on its own, but each of these commands triggers git to refresh its internal index, and that refresh is where the danger lies.

Git supports a performance setting called core.fsmonitor, which lets a repository specify a helper program that git runs automatically whenever the index refreshes. It is documented intended functionality, but it is read straight out of the repository’s own .git/config file.

That means a malicious repository can embed an arbitrary command in its configuration, and the moment an AI agent runs a routine context-gathering git command inside it, that command executes with the full privileges of the logged-in user, outside the sandbox and completely invisible to any permission system.

The attack cannot be delivered through a normal git clone, fetch, or pull, since those operations never transmit a hostile .git/config, reads the Manifold Security report.

Instead, the poisoned repository has to arrive as files, its .git directory intact, through a zipped folder, a shared drive, a synced directory, or a USB stick, exactly the way colleagues and consultants routinely hand off projects.

Tool / PlatformVulnerability MechanismSeverity & Remediation Status
Git Core Configurationcore.fsmonitor hook executed on background index refreshArbitrary local command execution outside agent sandboxes
Claude CodeAutomatic git context queries and ultrareview key abuseFour unpatched flaws tracked; 77M+ monthly npm downloads
GooseBackground context-gathering git command triggersFixed in latest vendor build; assigned CVE-2026-72718
Hermes AgentUnsanitized repository startup executionVendor unresponsive after six attempts; assigned CVE-2026-71963
Cursor & CodexVariant repository configuration executionBoth vendors shipped patches following independent discovery
Qwen Code & Grok BuildStartup context-gathering git invocationVulnerable to unauthenticated pre-execution file compromise

The research team confirmed the flaw across Claude Code, Goose, Hermes Agent, Qwen Code, and Grok Build, together representing close to half a million GitHub stars and, in Claude Code’s case alone, more than 77 million monthly npm downloads.

OpenAI’s Codex and Cursor were also found to be affected through variants of the same class; both were patched after being reported, though each was flagged as a duplicate of findings other researchers had independently filed.

Of the eight issues tracked, four remain unpatched at publication, including a distinct flaw in Claude Code’s ultrareview command that abuses a different git configuration key rather than core.fsmonitor, deliberately left unnamed to avoid handing attackers a working template.

Goose has already shipped a fix and received CVE-2026-72718, while Hermes was independently assigned CVE-2026-71963 after the vendor failed to respond across six contact attempts.

Developers who receive a repository as raw files rather than through a clone should inspect .git/config before opening it in any AI agent.

Vendors, meanwhile, are being urged to sanitize git configuration during background context-gathering calls, for instance by explicitly disabling core.fsmonitor, to close off this entire class of silent, pre-authentication code execution.

Learn 7 Metric-Gated AI SOC Deployment Phases – Download Free AI SOC Deployment Playbook 2026.

Guru Baran

Gurubaran KS is a cybersecurity analyst, and Journalist with a strong focus on emerging threats and digital defense strategies. He is the Co-Founder and Editor-in-Chief of Cyber Security News, where he leads editorial coverage on global cybersecurity developments.

Recent Posts

Google Chrome 153 Update Fixes 42 Security Flaws, Including 3 Critical Ones

Google has released an important Chrome 153 security update that fixes 42 vulnerabilities across the…

2 hours ago

CISA and NIST Release Technical Checklist for Safeguarding Identity Tokens From Theft and Misuse

The Cybersecurity and Infrastructure Security Agency (CISA) and the National Institute of Standards and Technology…

12 hours ago

CISA Shares 17 Techniques Used by Hackers to Compromise Active Directory Environments

CISA and five international cybersecurity agencies have released detailed guidance describing 17 common techniques hackers…

13 hours ago

Apple Rolls Out Massive Security Update Fixing 273 Vulnerabilities Across Its Devices

Apple has released one of its largest coordinated security rollouts, addressing 273 distinct critical vulnerabilities…

13 hours ago

How to Keep Malware’s Rotating Infrastructure From Becoming a Detection Gap

You can’t detect today's attacks with yesterday’s threat intelligence; that’s how you could briefly formulate…

13 hours ago

Microsoft Bans Its AI Models From Launching Cyberattacks or Escalating Their Own Access

Microsoft has published a draft Humanist AI Code of Conduct that would prohibit its in-house…

13 hours ago