• Security
  • Node.js
  • JavaScript

npm Supply-Chain Attacks in 2026: The Shai-Hulud Lesson

The Shai-Hulud worm and its clones hit hundreds of npm packages in 2026. How the attacks work and what every JavaScript team should change today.

1 min read
Chain links with a malicious package and a shield representing npm supply chain attacks

2026 has been the worst year yet for npm supply-chain attacks, driven by the "Shai-Hulud" worm and its copycats: malware that steals developer and CI credentials, then uses them to publish infected versions of more packages automatically. In the August 2026 wave targeting keyv and related caching libraries, ArmorCode counted more than 440 compromised packages within an hour, and Singapore's Cyber Security Agency reported over 1,300 affected package versions with a combined reach of around 2 billion monthly downloads.

How these attacks work

  1. Steal a maintainer's or CI pipeline's npm token.
  2. Publish a poisoned version of a legitimate, popular package.
  3. The install script runs on every machine that installs it, harvesting more tokens and cloud keys.
  4. Self-propagate: use the stolen tokens to infect the next set of packages.

According to Palo Alto Networks' Unit 42, the original Shai-Hulud in September 2025 marked the end of npm attacks being a "nuisance". In mid-2026 the worm's source code was reportedly released publicly, and clones followed quickly.

What to change today

  • Install with npm ci from a committed lockfile, so a new malicious version can't slip in during a build.
  • Delay new versions: don't auto-adopt releases published in the last few days. Most poisoned versions are caught and pulled within hours.
  • Disable install scripts by default where you can, and allow them per package.
  • Protect publishing: 2FA on npm, short-lived and narrowly scoped tokens, and trusted publishing from CI where available.
  • Keep secrets out of developer machines' environment and out of CI steps that don't need them.
  • If you're hit: rotate every credential the affected machine or pipeline could reach, then rebuild from clean. The CSA's advice says the same.

Shipping JavaScript safely

At NextGen Fusion, our Node.js development company in Lucknow, these controls are standard on every client project, because one bad dependency can expose a whole business.

Get your project's security reviewed.

Sources

  1. Singapore CSA advisory: npm supply chain attack affecting keyv (Shai-Hulud)
  2. ArmorCode: Shai-Hulud returns — 440+ compromised packages
  3. Unit 42: Monitoring npm supply chain attacks
Ritesh Kumar Giri

Written by

Freelance full-stack and WordPress developer in Lucknow. I build WooCommerce and Shopify stores, and custom Next.js platforms, for businesses across India.