Skip to the content
AI and Cybersecurity Learning and Practice Center Test automation Open the Learning Center

IncidentSupply chain

Shai-Hulud 2.0: npm worm returns and targets CI pipelines

CriticalZapierPostHogPostman

A second, more aggressive wave of the Shai-Hulud worm trojanized about 800 npm packages. It ran before install, spread mainly through CI/CD pipelines and leaked secrets into more than 25,000 GitHub repositories.

Replay the attack step by step in the Learning Center

How it happened

  1. Trojanized versions were published with stolen npm tokens, and each infection published more.
  2. A preinstall dropper installed the Bun runtime and launched a large obfuscated payload.
  3. It harvested GitHub, npm and cloud credentials and posted them to new public GitHub repositories.
  4. It registered infected machines as self-hosted GitHub Actions runners as a backdoor, and could wipe the home directory if theft failed.

Impact

Mass theft of cloud and CI/CD secrets, with most infections on build runners.

The fix

There is no single patch: pin to versions from before November 21, 2025, clear caches, rotate every credential and audit GitHub for rogue runners.

Lessons

  • Run installs in CI with lifecycle scripts disabled and only the secrets that job needs.
  • Use ephemeral runners and alert on new self-hosted runner registrations.
  • Assume any secret a build can reach can leak, and practice fast rotation.

Sources