Mozilla's 0din security team has revealed a method to trick AI coding agents into installing malware using minimal GitHub repositories. The exploit targets the helpfulness of tools like Claude Code, which can be prompted to initialize a project and inadvertently execute malicious code.
The attack works by embedding malicious instructions within a repository's structure, appearing clean to human reviewers. When an agent is asked to set up the project, it follows those hidden commands, compromising the system. This vulnerability stems from the agents' design to be maximally helpful without sufficient security checks.
The researchers demonstrated the exploit against Claude Code, showing how a seemingly innocent request to "initialize the project" led to malware installation. The attack requires no complex code obfuscation, just a crafted repository that exploits the agent's trust.
For developers relying on AI coding assistants, this poses a significant supply chain risk. Malicious actors could spread infected repositories, targeting those who use agents to automate setup tasks. The attack undermines the security assumptions of AI-assisted development workflows.
Mozilla's disclosure highlights a broader challenge in balancing AI helpfulness with security. Until safeguards are implemented, developers should exercise caution when using agents with untrusted repositories.