AI Coding Session Hijacked, Shai-Hulud Worm Infects 100 Internal Repos

In a recent case revealed in Mandiant’s September 2026 report, an attacker breached an AI-powered coding assistant session at a cloud-based software provider. During this takeover, malicious suggestions were accepted for software dependencies the attacker had already poisoned. This opened the door for further exploitation, including the spread of the Shai-Hulud worm through around 100 internal code repositories. The attacker also harvested repository secrets and proprietary source code belonging to the company’s products.

Attack Mechanics and Propagation

According to the investigation, the breach occurred after a developer adopted an AI-recommended third-party dependency that was malicious. Once that dependency was integrated, the attacker seized control of the developer’s active session and introduced an info-stealer via a tampered PyPI package. In tandem, GitHub OAuth tokens were exposed, paving the way for deeper access.

Following this, Shai-Hulud—known for self-replicating worm behavior—was deployed across approximately 100 internal repositories. The attacker even poisoned a package within the organization’s official namespace, causing a second wave of infection when another employee pulled the compromised version.

Pattern of AI-Enabled Threats in Software Security

This incident adds to a growing trend where bad actors move from using generative AI for automation to using it to carry out active intrusions. A previous report from March 2026 observed this exact shift—attackers began embedding AI components in malware and threat campaigns, rather than using them simply to speed development tasks.

Shai-Hulud has already been tied to a variety of attacks targeting developer tools, credentials, and supply chains. In August, for example, a worm associated with Keyv compromised numerous npm packages. It left behind hooks into AI tools like Claude Code and Visual Studio Code. Another variant of Shai-Hulud was discovered scanning hundreds of credential locations across developer systems, CI/CD pipelines, cloud infra, and AI tool assets. These operations—while related in theme—aren’t currently linked to the breach detailed here.

Defensive Measures for AI-Assisted Development

To counter this evolving risk, the report puts forward three core controls organizations should adopt. First, any third-party dependency suggested by AI should be verified via cryptographic checksum comparison or vetted against an approved allowlist. Second, keep raw API keys, long-lived OAuth tokens, and other sensitive secrets out of scope for extensions or unvetted tools. Third, ensure dependency traffic flows through regulated internal repositories to create choke points where validation can occur.

These precautions are especially vital as threat actors increasingly weaponize AI-driven recommendations and exploit the dependency and supply chain trust embedded in modern software development workflows.

Why this matters:As AI coding assistants become more ingrained in developer toolchains, this case demonstrates they can introduce critical vulnerabilities if abused. The Shai-Hulud infection illustrates how attacks can chain—from poisoned recommendations to credential theft and worm-style spread. Organizations embracing AI for productivity must balance speed with strong controls around dependencies, secrets, and review of AI tools. Going forward, watch closely for further exploit campaigns targeting dependency graphs and the integrity of AI-suggested code.