Urgent: npm Supply Chain Attack—What Developers Need to Know (September 2025)
The JavaScript community has been rocked this September by an unprecedented npm supply chain attack, exposing thousands of developers and organizations worldwide to new cyber risks.
A self-replicating malware, dubbed the "Shai-Hulud" worm, compromised over 180 (and potentially up to 500) npm packages, including some of the ecosystem's most widely used modules like chalk, debug, and ansi-styles. The attack began when npm maintainers were targeted with sophisticated phishing emails mimicking npm support, tricking them into handing over privileged credentials.
Once an account was breached, attackers published malicious updates to multiple packages. These updates included code designed to steal secrets such as npm tokens, GitHub PATs, and cloud API keys from developer environments. The malware didn't stop there—it then used the stolen credentials to propagate itself, compromising other packages owned by affected maintainers and uploading the stolen data to a public GitHub repository.
Trust in a widely-used package can be weaponized at scale in a matter of hours.
Packages named in the attack#
chalkdebugansi-stylesWhat should you do?#
- Immediately review all dependencies in your projects for suspicious or recently updated packages.
- Revoke and regenerate any possibly exposed API tokens and credentials.
- Ensure your npm and GitHub accounts have two-factor authentication enabled.
Check your lock file#
Run this in your project to see which version of an affected package you have installed. Compare it with the versions listed in the official advisories.
npm ls chalk debug ansi-stylesIf a compromised version shows up, follow these steps in order:
- Delete
node_modulesand your lock file. - Pin the package to a safe version in
package.json. - Run
npm installagain and commit the new lock file. - Rotate every token and key that was available on that machine.
This incident highlights the growing threat of software supply chain attacks, where trust in widely-used packages can be weaponized at scale. Stay vigilant, audit your dependencies, and keep your systems secure.
References#
Does your app have any of these problems?
Paste your website for a free quick check. About a minute, and nothing on your site is changed.