DepSentinel

← All posts

Shai-Hulud: from the first npm worm to the TanStack compromise

Incident: May 2026Published 30 November 2026npmwormGitHub Actionsprovenance

Shai-Hulud is the name researchers gave to a family of self-spreading npm worms. On 11 May 2026, a new wave called “Mini Shai-Hulud” published 84 malicious versions of 42 @tanstack/* packages in six minutes, through TanStack’s own release pipeline. Researchers saw its code and tactics again in the Red Hat compromise a few weeks later, and similar techniques in the ChainDrop worm.

A short history

How it got into TanStack

TanStack published a detailed postmortem. In short, the attacker never stole an npm password or token:

  1. A pull request that ran attacker code. A bundle-size workflow used the pull_request_target trigger and built code from a fork, so a malicious pull request ran on TanStack’s own runner.
  2. A poisoned cache. That run saved a tampered pnpm store into the GitHub Actions cache for the main branch.
  3. A stolen OIDC token. When the real release workflow later restored the cache, the attacker’s code read the workflow’s short-lived OIDC token out of the runner’s memory.
  4. Trusted publishing, used against them. The token was valid for npm’s trusted-publisher setup, so the malware published directly to npm as TanStack. Snyk reports that the malicious versions carried valid SLSA provenance, because they really were built by TanStack’s release workflow.

What the malicious versions did

npm removed the tarballs within about three to four and a half hours. TanStack purged its caches, restructured the vulnerable workflow and pinned its third-party actions to commit SHAs.

What to do

  1. Check lockfiles for the affected @tanstack/* versions from 11 May 2026 and for the other packages listed in the sources.
  2. If one was installed, treat the machine as compromised and rotate cloud, Kubernetes, Vault, GitHub, npm and SSH credentials. Follow Snyk’s advice on the dead man’s switch before revoking GitHub tokens.
  3. For maintainers: avoid pull_request_target workflows that build fork code, don’t share caches between untrusted and release workflows, and grant id-token: write only to the publish job.
  4. For consumers: a minimum release age (for example seven days) would have avoided this wave entirely. npm 12 also stops git dependencies and install scripts from running unless you approve them.

Where DepSentinel fits. DepSentinel would have shown warnings, but honestly not a strong alarm before advisories existed. The injected dependency was installed straight from a git commit, which gets a git-source signal, and the new @tanstack/* version gets fresh-release on its first day. Each package scores below the SUSPICIOUS threshold on its own. Because the versions had valid provenance, the provenance-dropped signal would not have fired, and this payload didn’t use a preinstall hook in the package itself, so install-script-added wouldn’t either. The reliable catch is OSV’s malicious-packages feed: once the versions are listed there, DepSentinel shows them as MALICIOUS with a “remove it” fix. It doesn’t scan the .vscode and .claude files the worm planted, so check those separately.

Am I affected?

The malicious versions added an @tanstack/setup dependency pointing at a GitHub commit. Search your lockfiles for it, and look for the files the worm drops into repositories:

grep -n "@tanstack/setup" package-lock.json pnpm-lock.yaml yarn.lock 2>/dev/null
ls .claude/router_runtime.js .claude/setup.mjs .vscode/setup.mjs 2>/dev/null

For other package managers, and what to do if you find a match, see how to check your project for malicious or compromised packages.

Sources

Details come from the public reports above and may change as investigations continue. Package names and versions are listed so you can check your own projects; verify them against the original sources before acting.

Related

Catch the next one in your editor. DepSentinel is a free VS Code extension that checks every dependency, including sub-dependencies, for known vulnerabilities and signs of a supply-chain attack. No account, no API key.

Install for VS Code   Open VSX (Cursor, VSCodium)