Malicious .git Configs Can Make Claude, Codex, Cursor, and Other AI Agents Run Attacker Code
-
Manifold Security has disclosed eight security flaws across seven command-line AI coding agents, where a repository’s own Git configuration can trick the tool into executing an attacker-controlled command on the developer’s machine. The attack relies on malicious
.gitconfig files, which can name a command that the agent unknowingly runs outside its sandbox and without an approval prompt.Four of the eight flaws remain unpatched at the time of publication. The affected agents include popular tools such as Claude, Codex, and Cursor, among others. The command executes with the privileges of the logged-in user, meaning a successful exploit could lead to credential theft, data exfiltration, or full local compromise.
Exploitation requires the repository to arrive on the target machine—via a cloned project, a pull request, or a compromised dependency—after which the embedded Git configuration triggers the agent into running the malicious command. The issue highlights a broader risk in AI-assisted development: the trust placed in repository metadata and the assumption that sandboxing is enforced consistently across agent implementations.
- Attack surface: malicious
.gitconfig files within a repository. - Impact: command execution as the current user, bypassing sandbox and approval prompts.
- Status: four of the eight vulnerabilities are still unpatched.
Source: The Hacker News
Are your development teams vetting repositories before letting AI agents open them, or is that trust still assumed by default?
- Attack surface: malicious
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login