Almost every modern website is assembled from open-source packages downloaded from npm, the JavaScript package registry. A typical Next.js site pulls in several hundred, most of them dependencies of dependencies that nobody on the project chose directly. For the past year attackers have been exploiting exactly that.
What happened
In September 2025 security researchers found a self-spreading worm in npm packages, named Shai-Hulud after the sandworms in Dune. It ran when a developer installed an infected package. It collected the npm tokens, GitHub tokens and cloud keys on the machine, published them to a public GitHub repository, then used the stolen npm access to inject itself into other packages that developer maintained. Hundreds of packages were affected.
A second wave in November 2025 was much larger. Palo Alto Networks' Unit 42 counted more than 25,000 malicious GitHub repositories created across about 350 accounts. This version ran before installation finished, so build servers were hit without anyone opening anything. When it couldn't steal anything, it could wipe the victim's home folder.
It didn't stop there. A campaign researchers call Mini Shai-Hulud has been active since late April 2026. On 11 May 2026 it pushed 84 malicious versions of 42 packages from TanStack, a widely used library family, carrying credential stealers. They were spotted within about 20 minutes, but a build that ran in those minutes would have installed them.
Why a business owner should care
The target isn't your visitors. It's whoever builds and deploys your site. A poisoned package on a developer's laptop or a build server can steal the keys to your hosting, your database, your payment provider and your source code. From there, an attacker can change your live site.
If your website is built by a freelancer or an agency, their security is your security.
What good practice looks like
Ask whoever maintains your site whether they do these:
- Lock versions. A lockfile pins the exact version of every package, and builds install from it (
npm ci), so a new malicious release isn't picked up silently. - Don't update the moment a release lands. Waiting a few days before adopting new versions avoids most of these attacks; they are usually caught within hours.
- Audit dependencies on every build, and fail the build on known-compromised versions.
- Keep secrets out of reach. Build servers get the minimum keys they need, tokens are short-lived where possible, and nothing long-lived sits in a developer's shell.
- Turn on two-factor authentication for npm, GitHub and hosting accounts, preferably with a security key or passkey.
- Have a rotation plan. If an incident is announced, every token and key that could have been exposed is replaced the same day.
This site follows the same rules: exact versions in a lockfile, clean installs in CI, and a dependency audit on every push. You can read how it's built and run on our trust page. If you'd like us to review how your site is built and deployed, get in touch.
Sources: Unit 42 on the Shai-Hulud npm attacks (Palo Alto Networks) · Supply chain attack on TanStack (heise online)
Comments
No comments yet.