Massive “Worm-Style” Attack Spreads Across 187 npm Packages, Hitting CrowdStrike and 2M+ Downloads

# Massive ‘Shai-Hulud’ Supply Chain Attack Compromises 187 npm Packages

Security researchers have uncovered a sophisticated supply chain attack targeting the npm JavaScript registry, compromising at least 187 packages in a self-propagating campaign dubbed ‘Shai-Hulud.’ The attack began with the popular @ctrl/tinycolor package, which receives over 2 million weekly downloads, and has since spread to packages under major cybersecurity firm CrowdStrike’s namespace.

## How the Attack Unfolded

The attack was first identified by Daniel Pereira, a senior backend software engineer, who alerted the community to the ongoing threat. Despite attempts to contact GitHub through private channels, Pereira was forced to make the attack public due to the severity and rapid spread of the malware.

Security firms Socket, Aikido, and StepSecurity quickly began investigating, initially identifying 40 compromised packages before the count escalated to 187. The attack’s name comes from the “shai-hulud.yaml” workflow files found in the malicious code, referencing the giant sandworms from Frank Herbert’s Dune series.

## Technical Details of the Worm

The malware operates as a self-propagating worm with sophisticated capabilities:

– **Automatic Spread**: Downloads packages from the same maintainer, modifies their package.json files, injects malicious bundle.js scripts, and republishes them
– **Secret Harvesting**: Abuses TruffleHog, a legitimate security scanning tool, to search for API keys, passwords, tokens, and cloud credentials
– **Credential Validation**: Tests discovered credentials to ensure they’re active and usable
– **Unauthorized Access**: Creates GitHub Actions workflows within compromised repositories
– **Data Exfiltration**: Sends stolen information to a hardcoded webhook endpoint

## Impact on Major Organizations

CrowdStrike confirmed that several packages under their npm account were compromised but emphasized that their core Falcon sensor platform remains unaffected. The company quickly removed the malicious packages and rotated their security keys.

Google’s Gemini CLI was also impacted, though the company clarified that their source code and servers remained secure. Users who installed or updated the CLI during the attack window may have been affected.

## Part of a Larger Trend

This attack follows a concerning pattern of supply chain compromises in September 2024:

– The ‘s1ngularity’ attack affected 2,180 GitHub accounts using AI-powered malware
– Maintainers of popular chalk and debug npm packages fell victim to phishing attacks
– Security experts suspect potential connections between these incidents

## Protecting Against Supply Chain Attacks

Organizations and developers should take immediate action:

**Immediate Steps:**
– Audit environments and logs for signs of compromise
– Rotate all secrets, API keys, and CI/CD tokens
– Review dependency trees for malicious package versions

**Long-term Protection:**
– Pin dependencies to trusted, verified releases
– Limit the scope of publishing credentials
– Implement robust monitoring for dependency changes
– Use security scanning tools to detect compromised packages

## The Bigger Picture

This incident highlights the fragility of modern software supply chains, where a single compromised maintainer account can affect hundreds of downstream projects. As software development increasingly relies on third-party packages, the need for enhanced security measures and vigilant monitoring becomes critical.

The ‘Shai-Hulud’ attack demonstrates how attackers are becoming more sophisticated, using legitimate tools like TruffleHog for malicious purposes and creating self-propagating mechanisms that can rapidly spread across the software ecosystem. Organizations must prioritize supply chain security as a fundamental component of their cybersecurity strategy.

Share This Article