Skip to main content
Blog
Blog Attacks

The Snowball Effect: How Mini Shai-Hulud Turns npm into a Worm Distribution Network

Mini Shai-Hulud turned npm packages into a credential-theft loop. Here is how the AntV wave spread and what teams should monitor next.

May 19, 2026 6 min read
Simon Wijckmans
Simon Wijckmans Founder & CEO
Dark cside banner showing an npm worm supply chain attack

TL;DR

Mini Shai-Hulud is a warning about how npm compromise spreads after the first malicious publish. The attacker does not need to compromise every downstream application directly. They need one maintainer account, one CI path, or one install-time execution path that exposes credentials.

As of 2026-05-19, Socket reported 639 compromised package versions across 323 unique packages in a Mini Shai-Hulud wave concentrated around the @antv ecosystem. The affected package set included charting, graphing, mapping, and React wrapper packages used by engineering teams that may never think of those dependencies as security-critical.

The pattern is the real issue. npm is useful because it centralizes publishing, scanning, and takedown. The same centralization becomes dangerous when lifecycle scripts, trusted publishing, and maintainer credentials are abused to turn packages into a distribution network.

What happened in the AntV wave

The AntV wave used a familiar npm entry point: install-time execution. Socket's analysis describes a root-level index.js payload that modified package.json so the payload ran during preinstall.

That matters because npm install, pnpm install, and yarn install are not passive download steps. Package lifecycle scripts can execute code before a developer reviews the package contents or runs the application.

The payload was heavily obfuscated. Socket reported that it used runtime string decoding, encrypted exfiltration, GitHub API usage, npm registry API usage, and a hardcoded HTTPS exfiltration path. The goal was not just to run malware once. The goal was to collect credentials that let the malware publish again.

How Mini Shai-Hulud creates the snowball effect

The payload targets developer and CI/CD environments because those environments hold publishing power. A browser application may only need a charting package, but the machine or workflow that installs it may also have access to npm, GitHub, AWS, Kubernetes, Vault, SSH, Docker, or database credentials.

The credential targets include:

  • GitHub tokens and GitHub Actions OIDC material
  • npm publishing tokens
  • AWS credentials and instance metadata
  • Kubernetes service account files
  • HashiCorp Vault tokens
  • Docker authentication files
  • SSH keys and private keys
  • Database connection strings

Once the malware finds usable npm credentials, it can enumerate packages the victim can maintain, modify package tarballs, add an install-time hook, bump versions, and republish compromised packages under a trusted maintainer identity.

Diagram showing Mini Shai-Hulud spreading through compromised npm credentials and republished packages

Why Axios and TanStack matter

The AntV wave did not happen in isolation. The npm ecosystem has seen a series of incidents where attackers abuse trusted maintainers, transitive dependencies, and CI/CD automation.

Datadog's Axios analysis describes how an attacker hijacked an Axios maintainer account on 2026-03-31 and published malicious axios releases that added a trojanized plain-crypto-js dependency. That dependency downloaded and executed a cross-platform remote access trojan during install.

Diagram showing the Axios npm compromise chain through a trojanized dependency

Endor Labs' TanStack analysis shows a different lesson. TanStack used npm OIDC trusted publishing, which removes long-lived static npm tokens. The attacker still obtained a valid publishing path through repository and workflow mechanics. The result was malicious versions across the TanStack namespace with valid-looking provenance.

The common thread is not one broken tool. It is the amount of authority concentrated in developer environments and release workflows.

npm is both a defender tool and an attack path

npm gives defenders a central place to inspect packages, flag malware, deprecate releases, and revoke tokens. That centralized model is better than opaque one-off downloads.

But npm also gives attackers a central distribution layer. If a trusted package ships a malicious version, downstream users can fetch it through ordinary installs, lockfile updates, CI rebuilds, or transitive dependency resolution.

npm featureDefensive valueAttack value
Central registryEnables scanning, advisories, and takedownGives malicious versions broad distribution
Lifecycle scriptsSupports package setup and native buildsRuns attacker code during install
Maintainer accountsLets projects publish quicklyTurns one compromised identity into many poisoned packages
Trusted publishingReduces long-lived token exposureCan be abused if the workflow or trust boundary is compromised

The lesson is not to abandon npm. The lesson is to reduce automatic trust at each stage where code executes.

What teams should do now

Start with the build and developer environment. Any machine or CI runner that installed an affected package should be treated as exposed until credentials are reviewed.

  1. Check lockfiles and package manager logs for affected versions installed on or after 2026-05-19
  2. Rotate npm, GitHub, cloud, Vault, SSH, Docker, and database credentials that were accessible to those systems
  3. Audit maintainer-owned packages for unexpected versions, install hooks, or added git dependencies
  4. Use strict lockfile installs such as npm ci, pnpm install --frozen-lockfile, or yarn install --frozen-lockfile
  5. Disable lifecycle scripts where practical with --ignore-scripts, especially in CI jobs that do not need native builds
  6. Add dependency cooldowns or review gates so newly published package versions do not enter production automatically
  7. Monitor outbound traffic from CI and developer workstations for suspicious exfiltration paths

These controls reduce the chance that one malicious package becomes a publishing incident across every package a developer maintains.

Where cside fits

cside is not an npm registry scanner, and it does not replace CI/CD hardening. You still need dependency scanning, lockfiles, token hygiene, and strict release controls.

cside covers the browser-runtime part of the supply chain. Many production sites load third-party scripts, SDKs, tag manager payloads, analytics packages, and dynamically delivered code that never behaves like a fixed npm dependency. A package or vendor can look legitimate at build time and still deliver risky behavior to the browser later.

cside monitors script behavior as it runs in the user's browser. That includes script changes, unexpected data access, suspicious exfiltration attempts, and browser-side activity that dependency scanners cannot see once the code is already in production.

The right defense is layered: secure the registry path, harden CI, rotate secrets fast, and monitor runtime behavior where users actually execute the code.

Further reading on cside

Simon Wijckmans
Founder & CEO Simon Wijckmans

Founder and CEO of cside. Building better security against client-side executed attacks, and making solutions more accessible to smaller businesses. Web security is not an enterprise only problem.

FAQ

Frequently Asked Questions

Mini Shai-Hulud is a supply chain malware pattern that abuses trusted package publishing paths, install-time scripts, and stolen developer credentials to infect more packages.

Socket reported 639 compromised package versions across 323 unique packages on 2026-05-19, mostly in the AntV ecosystem. The scale matters because downstream teams can pull malicious versions automatically through normal dependency updates.

No. cside complements dependency scanners and CI controls by monitoring browser-runtime script behavior, script changes, and data exfiltration paths that build-time tools do not see.

Monitor and Secure Your Third-Party Scripts

Gain full visibility and control over every script delivered to your users to enhance site security and performance.

Start free, or try Business with a 14-day trial.

cside dashboard interface showing script monitoring and security analytics
Related Articles
Book a demo