ChainDrop: How a Self-Propagating npm Worm Compromised More Than 400 Packages
Software supply-chain attacks are becoming one of the most dangerous problems facing modern development teams. Instead of attacking an application directly, threat actors increasingly target the software, credentials and automated pipelines used to build it.
A recent campaign demonstrates just how effective this approach can be.
Security researchers from Palo Alto Networks’ Unit 42 identified a self-propagating npm worm dubbed ChainDrop that infected more than 400 packages, including widely used libraries such as keyv and cacheable-request. Collectively, the affected packages receive hundreds of millions of downloads every week.
The campaign potentially exposed developer workstations, CI/CD environments, cloud infrastructure and downstream software users.
ChainDrop Is More Than a Malicious npm Package
Traditional malicious-package attacks often depend on a developer installing a compromised package.
ChainDrop takes the concept further.
The malware is designed to propagate itself using credentials stolen from compromised development environments.
According to Unit 42, once executed, the malware can steal:
- cloud credentials,
- npm authentication tokens,
- GitHub tokens,
- SSH keys,
- developer information,
- CI/CD secrets.
The stolen npm credentials can then be used to publish additional compromised packages, allowing the malware to spread further while preserving the legitimate functionality of the original software.
This creates a dangerous cycle:
Compromised package → developer environment → credential theft → package publishing credentials → new compromised packages → more victims
Why the npm Ecosystem Is Such an Attractive Target
npm is one of the foundations of the modern JavaScript ecosystem.
Developers routinely install dependencies with commands such as:
npm install
A modern project can depend on hundreds or even thousands of packages, including dependencies of dependencies.
This creates a massive trust relationship.
A developer might never have heard of a particular package, yet their application could still install it because another dependency requires it.
Attackers understand this dependency chain.
Instead of trying to compromise thousands of developers individually, they can target a package or maintainer and allow the software supply chain to distribute the malicious code.
ChainDrop Targets Developer Credentials
One of the most concerning aspects of ChainDrop is its focus on credentials.
Compromising a developer machine is useful.
Compromising the credentials stored on that machine can be much more valuable.
Attackers may potentially gain access to:
- GitHub repositories,
- npm publishing accounts,
- cloud services,
- CI/CD systems,
- SSH infrastructure,
- environment variables,
- temporary cloud credentials.
Unit 42 reports that ChainDrop can also extract temporary credentials from the memory of GitHub Actions runners.
That means the attack isn’t necessarily limited to a single developer workstation.
A compromised CI/CD environment can become another propagation mechanism.
The Attack Can Propagate Automatically
This is what makes ChainDrop particularly dangerous.
Traditional malware often requires attackers to compromise each target individually.
A self-propagating supply-chain worm can potentially automate part of that process.
Once attackers obtain valid npm publishing credentials, the malware can use them to publish additional malicious versions of packages.
The newly compromised packages then become potential infection points for other developers.
The legitimate functionality of the packages can remain intact, making the compromise harder to notice.
This is a critical difference between a simple malicious package and a self-propagating supply-chain attack.
Legitimate Software Can Continue Working
One of the biggest challenges in detecting supply-chain malware is that the application may continue functioning normally.
A compromised package does not necessarily need to break anything.
In fact, keeping the original functionality intact can be an important part of the attack strategy.
Developers run their applications.
Tests pass.
The software appears to work.
Meanwhile, malicious code can operate in the background.
This makes traditional troubleshooting ineffective.
A system that behaves normally is not necessarily a system that has not been compromised.
CI/CD Pipelines Are a High-Value Target
Modern software development relies heavily on automation.
GitHub Actions, GitLab CI/CD, cloud build systems and other platforms routinely receive access to sensitive credentials.
They may need those credentials to:
- publish packages,
- deploy applications,
- access cloud infrastructure,
- build containers,
- communicate with APIs,
- release software.
This makes CI/CD environments extremely attractive to attackers.
If malware can access temporary credentials or secrets inside a build runner, the consequences can extend far beyond the original machine.
Microsoft has previously documented similar Shai-Hulud supply-chain campaigns in which attackers targeted developer environments, CI/CD pipelines and cloud-connected workloads to harvest credentials and secrets.

ChainDrop Is Part of a Larger Trend
ChainDrop should not be treated as an isolated incident.
The npm ecosystem has experienced several major supply-chain attacks during 2026.
Unit 42 has documented multiple campaigns involving Mini Shai-Hulud, including attacks affecting npm and PyPI. In May, one campaign compromised hundreds of malicious package versions, while later campaigns targeted additional developer ecosystems.
Another campaign in June compromised at least 32 packages under the @redhat-cloud-services namespace and used malware called Miasma to steal developer and cloud credentials.
The pattern is becoming clear:
Attackers are increasingly attacking the software factory itself.
Why Package Popularity Doesn’t Guarantee Safety
Developers sometimes assume that a package with a large number of downloads must be trustworthy.
That assumption is dangerous.
A popular package can still be compromised.
A trusted maintainer account can be hijacked.
A legitimate CI/CD pipeline can be abused.
A previously safe version can be replaced by a malicious release.
Even a package with millions of downloads can therefore become an attack vector.
ChainDrop demonstrates why package reputation alone cannot be treated as a security control.
How Developers Can Defend Against npm Supply-Chain Attacks
There is no single security measure that eliminates this risk, but organizations can make these attacks considerably harder.
Lock dependency versions
Avoid allowing production environments to automatically pull arbitrary new versions.
Use lockfiles and controlled dependency updates.
Monitor dependency changes
Unexpected changes to package size, lifecycle scripts or dependencies should trigger investigation.
A sudden introduction of installation scripts deserves particular attention.
Minimize publishing privileges
npm publishing credentials should have the smallest practical scope.
Where possible, use short-lived credentials and stronger authentication mechanisms.
Protect CI/CD secrets
Secrets should not be unnecessarily exposed to build processes.
Organizations should also monitor unusual access to GitHub, npm and cloud credentials.
Use software composition analysis
Dependency scanning can help identify known vulnerabilities and suspicious package changes.
However, organizations should remember that a completely new malicious package may not yet have a CVE.
Supply-chain security therefore requires more than vulnerability scanning.
Monitor package behavior
Security teams should look for suspicious:
- outbound connections,
- credential access,
- unexpected child processes,
- package installation scripts,
- changes to repositories,
- package publishing activity.
Behavioral detection can be particularly important when the malicious package still performs its legitimate function.
The Bigger Lesson From ChainDrop
The most important lesson from ChainDrop is not simply that 400+ npm packages were compromised.
It is that modern software development creates a huge network of implicit trust.
Developers trust packages.
Packages trust maintainers.
CI/CD systems trust credentials.
Cloud infrastructure trusts automation.
And attackers are increasingly looking for ways to move through that chain.
ChainDrop demonstrates how one compromised component can potentially become the starting point for a much larger campaign affecting developers, repositories, cloud infrastructure and downstream applications.
The software supply chain has therefore become a security perimeter in its own right.
For organizations using npm, the question is no longer simply “Is this package vulnerable?”
A more important question is:
“Can I verify that this package, its maintainer, its build pipeline and its dependencies are trustworthy?”
That shift in thinking will become increasingly important as supply-chain attacks continue to evolve.






