Malicious .git Configs Can Make Claude, Codex, Cursor, and Other AI Agents Run Attacker Code

A Critical Vulnerability in AI-Powered Agents Exposes Millions of Users to Malicious Code Injection

A shocking discovery has been made regarding a critical vulnerability in popular artificial intelligence (AI) agents, including Claude, Codex, and Cursor. Researchers have found that malicious configuration files (.git configs) can be used to inject attacker code into these agents, putting millions of users at risk. This exploit works by manipulating the configuration settings of the AI agent’s underlying repository, allowing attackers to execute arbitrary commands.

The vulnerability affects a wide range of users who rely on AI-powered tools for various tasks, from content generation and writing assistance to coding and development support. The impacted agents are designed to integrate with popular platforms such as GitHub, where developers often store their project code in repositories managed by Git version control systems. An attacker can craft a malicious .git config file that, when loaded into the AI agent’s repository, enables them to inject malicious code and execute it on behalf of the user.

The technical underpinnings of this exploit are rooted in the way these AI agents handle configuration settings. When an AI agent is integrated with a Git repository, it uses the .git config file to manage its settings and behavior. A skilled attacker can create a malicious .git config file that contains hidden commands or scripts, which can then be executed by the AI agent without the user’s knowledge or consent.

This vulnerability matters because it exposes millions of users to the risk of having their AI-powered tools compromised. Attackers could use this exploit to gain access to sensitive data, inject malware into systems, or even hijack entire development projects. The severity of this issue is compounded by the fact that many users rely on these AI agents for critical tasks, making them vulnerable to exploitation.

To mitigate this risk, users should be cautious when sharing their repository credentials with any AI-powered tool. Developers and platform administrators must also take immediate action to address this vulnerability, including updating AI agent integrations and implementing robust security measures to prevent malicious .git config files from being loaded into repositories. By staying informed and taking proactive steps to secure our digital workflows, we can minimize the impact of this critical vulnerability and protect ourselves against future threats.

In light of this discovery, users should take a closer look at their AI-powered tool integrations and ensure that they are not inadvertently exposing themselves to risk. This means regularly reviewing repository settings, being cautious when sharing credentials with third-party tools, and staying up-to-date on the latest security patches and updates for these agents. By taking these precautions, we can safeguard our digital workflows and prevent attackers from exploiting this critical vulnerability.


Source: The Hacker News — 2026-09-02