Almost every modern website and app is assembled from open-source building blocks. A typical JavaScript project pulls in hundreds of packages from the npm registry, most written by volunteers the business has never heard of. In September and November 2025 that trust was abused on an unusual scale. Attackers hijacked the accounts of popular package maintainers and published poisoned versions, and a self-spreading worm called Shai-Hulud used stolen tokens to infect more packages and leak secrets from thousands of code repositories. GitHub, which runs npm, responded with the biggest change to publishing security in the registry’s history. This post explains what happened, what changed, and what a business that builds or commissions software should do.

Why your website depends on strangers
A software supply chain attack targets something your software depends on rather than the software itself. If an attacker can change a popular library, every project that installs the new version runs the attacker’s code. Package registries such as npm for JavaScript, PyPI for Python and the WordPress plugin directory make it easy to reuse code, which is why they are attractive targets.
The risk is not new. In March 2024 a backdoor was discovered in xz-utils, a compression library used in many Linux distributions, after a long campaign by an attacker who had become a trusted maintainer. It was caught before it reached most stable systems. The 2025 npm incidents were faster and noisier, but they exploited the same thing: trust in maintainers and their accounts.
September 2025: chalk and debug
On 8 September 2025 a maintainer of several small but extremely popular JavaScript packages received a convincing phishing email asking him to update his two-factor authentication details. The attacker used the stolen access to publish new versions of 18 packages, including chalk, which colours terminal text, and debug, a logging helper. Sonatype and others reported that these packages together receive billions of downloads a week.
The malicious code targeted browsers: it watched for cryptocurrency transactions and tried to swap the destination address for one controlled by the attacker. The community spotted it within hours and the bad versions were removed, so the financial damage appears to have been small. The lesson was the speed and reach: any project that installed fresh versions in that window, including automated builds, pulled in the malware.
Shai-Hulud: the worm that spread itself
Days later a more dangerous campaign appeared. Named Shai-Hulud after a file it created, this malware ran when a developer installed an infected package. It searched the developer’s machine and build systems for credentials, including npm tokens, GitHub tokens and cloud keys, and published them. Where it found an npm token, it used it to publish infected versions of that developer’s own packages, so it spread like a worm.
| Incident | When | Reported scale | Main damage |
|---|---|---|---|
| chalk and debug hijack | 8 September 2025 | 18 packages with very high download counts | Crypto address swapping in browsers |
| Shai-Hulud | Mid-September 2025 | 187 to 500+ packages, depending on the count | Stolen tokens and secrets; self-propagation |
| Shai-Hulud 2.0 | November 2025 | More than 25,000 GitHub repositories exposing secrets (Wiz) | Mass leak of credentials from developers and CI |

The stolen secrets are the long tail of the incident. Every leaked cloud key or database password had to be found and rotated, and anything not rotated remained a way in long after the malicious packages were removed.
What npm and GitHub changed
GitHub published a plan for a more secure npm supply chain in September 2025 and rolled it out over the following months. The changes target the stolen long-lived tokens that made the worm possible.
- Classic tokens retired. Creating new classic npm tokens was disabled in November 2025 and existing ones were revoked shortly after.
- Short-lived granular tokens. Granular tokens with publish rights default to a seven-day lifetime, with a 90-day maximum.
- Stronger two-factor authentication. Publishing from a developer’s machine requires 2FA, with a push towards phishing-resistant methods.
- Trusted publishing. Packages can be published from GitHub Actions or GitLab CI using short-lived identity tokens instead of stored secrets.
These changes make the specific Shai-Hulud technique much harder, but they do not stop a maintainer being phished, and they only help packages whose maintainers adopt them. Consumers of packages still need their own controls.
Is your business exposed?
A business that never writes code can still be affected through the software it commissions and runs.
| Your situation | Exposure | Main concern |
|---|---|---|
| A brochure WordPress site with a few plugins | Low to medium | Plugin updates; less npm, more plugin supply chain |
| A custom website or web app built with React, Vue or Next.js | Medium to high | Build process pulls hundreds of npm packages |
| A mobile app built by an agency | Medium | JavaScript or other package ecosystems in the build |
| An in-house development team | High | Developer machines, CI secrets and publishing rights |
The plugin ecosystem of WordPress faces the same kind of risk: an abandoned plugin can be bought or hijacked and updated with malicious code. Our patch management guide covers how to keep updates prompt without blindly installing every one.
Controls for teams that build software
- Commit lockfiles and install from them. Use
npm ciin builds so the exact tested versions are installed, not whatever was published an hour ago. - Delay new versions. Many malicious releases are caught within hours or days. Waiting a few days before adopting a new version, except for urgent security fixes, avoids most of them.
- Limit install scripts. Disable automatic install scripts where you can, since that is how Shai-Hulud ran.
- Keep secrets out of developer machines and code. Use a secrets manager and short-lived credentials; never store long-lived cloud keys in environment files.
- Use trusted publishing and 2FA if you publish packages yourself.
- Scan dependencies. Use dependency scanning and tools such as OpenSSF Scorecard to spot risky or abandoned packages.
- Separate build and deploy. Builds should not hold production credentials they do not need.

These steps align with NIST’s Secure Software Development Framework, which is a useful reference if a customer asks how you manage software risk. A staged release process helps too; our post on website release processes with staging and backups explains how to catch problems before they reach visitors.
Questions to ask your web developer
If an agency or freelancer builds and maintains your software, you do not need to understand npm, but you should ask a few questions and expect clear answers.
| Question | A good answer sounds like |
|---|---|
| How do you decide when to update dependencies? | Regularly, from a lockfile, with a short delay except for security fixes |
| Where are our production passwords and keys stored? | In a secrets manager, not in code or on laptops |
| Who can deploy to our live site, and how? | A named few, through a pipeline with 2FA and logs |
| What happens if a package we use is compromised? | We can identify affected builds quickly and rotate secrets |
| Do you scan for vulnerable or malicious packages? | Yes, automatically on every build |

Our vendor security vetting checklist includes questions like these, and our web development and hosting team builds with lockfiles, staged releases and managed secrets as standard.
Frequently asked questions
What is a software supply chain attack?
An attack that compromises something your software depends on, such as an open-source library or a build tool, so that your software runs the attacker’s code when it is built or installed.
Was my website affected by the 2025 npm attacks?
Only if it was built or rebuilt with the affected package versions during the short windows they were available. Ask your developer to check build dates and lockfiles.
Does WordPress have the same problem?
It has a similar one. Plugins and themes are third-party code, and abandoned or hijacked plugins have been used to spread malware. Use well-maintained plugins and keep them updated.
Should we stop using open-source software?
No. Commercial software uses open source too. The answer is managing it: pinned versions, careful updates, scanning and short-lived credentials.
What is trusted publishing?
A way to publish packages from a CI system using a short-lived identity token issued for that one job, instead of a long-lived password or token stored as a secret.
Want your website’s build and update process reviewed? Get in touch with Eudora Technology to talk about your project.
Sources
- npm chalk and debug packages hit in software supply chain attack
- Widespread npm supply chain attack: breaking down impact and scope across debug, chalk and beyond
- Self-propagating supply chain attack hits 187 npm packages
- Our plan for a more secure npm supply chain
- npm security update: classic token creation disabled and granular token changes
- Secure Software Development Framework (SSDF)
- OpenSSF Scorecard



