AI Coding Assistant Hijacked to Spread Malware Across 100 Repositories

A security report reveals that an attacker exploited an active AI coding session to install malware, leading to the compromise of hundreds of internal code repositories.
A recent security incident demonstrates how artificial intelligence tools intended to assist developers can become a vector for sophisticated cyberattacks. According to a report from Mandiant, an attacker successfully hijacked an active session with an AI coding assistant at an unnamed software-as-a-service provider. This breach did not just target a single system; it allowed the intruder to spread the Shai-Hulud worm across approximately 100 internal code repositories, stealing sensitive source code and security credentials.
The incident highlights a growing risk in modern development environments where AI agents have direct access to sensitive infrastructure. The attacker did not need to break into the system through traditional means but instead leveraged the trust placed in the AI assistant. By poisoning the software ecosystem around the tool, the intruder was able to execute malicious code under the guise of a legitimate recommendation, bypassing several standard security checks.
Attackers Exploit Trusted AI Recommendations
The attack began when the AI assistant recommended a third-party software package to the developer. Unbeknownst to the user, this package had been poisoned by the attacker. When the developer accepted the recommendation, the system installed a malicious information stealer through a compromised package on the Python Package Index. This initial foothold gave the attacker access to the developer's active session, allowing them to steal GitHub OAuth tokens and install further malware.
Once inside, the attacker deployed the Shai-Hulud worm, which is designed to self-propagate across networked systems. The worm spread to about 100 internal repositories, exfiltrating secrets and source code. The situation worsened when the attacker also poisoned a package within the company's own official namespace. Another employee, trusting the internal source, downloaded the compromised version, resulting in a second distinct infection. This dual-vector approach ensured that the breach had a widespread impact across the organization's development infrastructure.
Defenders Need Stricter AI Controls
Mandiant has outlined specific measures to mitigate these risks in AI-assisted development environments. The primary recommendation is to verify all AI-recommended third-party dependencies against cryptographic checksums and approved allowlists. This prevents the installation of tampered packages. Additionally, organizations should ensure that raw API keys and long-lived OAuth tokens are not directly accessible by AI extensions. Routing all dependency traffic through controlled internal repositories can also limit the exposure to malicious external packages.
Rising Threats to Developer Tools
This incident is part of a broader trend where attackers are targeting developer tools and AI integrations. The Hacker News has previously reported on similar campaigns, including one in August where a worm poisoned hundreds of packages to plant hooks in popular coding assistants. Recent analyses have also found variants of the Shai-Hulud worm scanning hundreds of locations on developer systems for credentials. While these specific attacks are not linked to the unnamed provider in the Mandiant report, they collectively signal that AI coding assistants have become high-value targets for cybercriminals.






