Cybersecurity Sep 3, 2026Add to bookmarks

The Hacker News documents a new class of attack: malicious .git configurations that, when read by AI coding agents, execute attacking code. The tools meant to secure become vectors.
The Hacker News reported on September 2, 2026, a newly documented attack technique: Git configuration files—the classic .git/config present in every repository—can be crafted to execute arbitrary code on AI coding agents when they open or analyze the repository.
Affected agents include:
The vector: Git allows certain directives in its configuration (hooks, aliases, filters) that trigger the execution of shell commands. An AI agent that "takes over" a cloned repository—to analyze it, commit changes, or run tests—executes these commands with the rights of the user who launched the agent.
The most dangerous scenario: an attacker publishes a malicious repository on GitHub, a developer asks their agent to "analyze this project," and the agent silently executes the payload embedded in the .git/config—with access to everything the developer can read (SSH keys, tokens, private files).
This family of attacks flips the usual narrative. Until now, AI coding agents were presented as defensive reinforcements: they read code, detect vulnerabilities, and produce patches. Here, they become the attack surface. Malicious code doesn’t need to be executed by a human: it just needs an agent to read the Git config.
We’ve been tracking the rise of autonomous AI agents as intrusion vectors—DeepSeek on servers, Claude breaching three organizations, Azure DevOps MCP hijacked, Cursor used by Aurora Ransomware to generate payloads. The novelty here is that it’s not the agents attacking; it’s the agents being attacked through a mundane artifact—a config file no one ever reads.
git config -file .git/config -unset-all on sensitive directives (core.hooksPath, core.fsmonitor, suspicious aliases) before analysis.The .git/config file exists in every Git repository. No developer reads it before cloning. It is now a code execution vector for Claude Code, Codex, and Cursor.
Key takeaway: the security of AI coding agents is no longer just about the prompt, but about every artifact they touch—Git configs, project files, hooks. Treat every unknown repository like an unsigned binary: in a sandbox, never on your dev machine.
Article produced by artificial intelligence, reviewed under human editorial control.
Un fichier .git piégé peut faire exécuter du code par Claude Code, Codex et Cursor