npm

The TanStack npm Supply Chain Attack

Updated 5 Oct 2026 · Incident date 11 May 2026

Attackers published 84 malicious versions across 42 @tanstack npm packages, each with a new hidden file that collected build secrets, on 11 May 2026.

Each bad version carried a hidden file named router_init.js that ran at install time and stole build secrets. The same campaign, Mini Shai-Hulud, also hit packages from Mistral AI, UiPath, OpenSearch and Guardrails AI.

What happened

An attacker used three chained flaws in the TanStack GitHub Actions setup to publish poisoned packages straight to npm.

  • The attacker opened a pull request from the fork zblgg/configuration. A pull_request_target workflow ran its build code with no approval gate.
  • That code wrote a poisoned 1.1 GB pnpm store entry into the shared GitHub Actions cache. A workflow on the main branch restored it.
  • Malicious binaries read the runner memory, took the OIDC token and posted it to registry.npmjs.org.
  • Each bad tarball gained router_init.js and a new optionalDependencies entry that pulled a payload from the attacker's fork.
  • The payload sent out AWS, GCP, Kubernetes, Vault, npm, GitHub and SSH credentials. It installed a gh-token-monitor daemon that runs rm -rf ~/ when the stolen token is revoked.

The first 42 packages went live at 19:20 UTC on 11 May 2026. TanStack deprecated all 84 versions by 21:03 UTC.

Affected versions

  • Two versions of each of 42 packages in the @tanstack scope, 84 in total. TanStack lists them in advisory GHSA-g7cv-rxg3-hmpx.
  • @tanstack/react-router, @tanstack/vue-router, @tanstack/solid-router and @tanstack/router-core: 1.169.5 and 1.169.8.
  • @tanstack/react-start: 1.167.68 and 1.167.71.
  • @tanstack/router-plugin: 1.167.38 and 1.167.41.
  • @tanstack/history: 1.161.9 and 1.161.12.
  • Not affected: query, table, form, virtual, store and the @tanstack/start meta-package.
  • Wiz counts more than 120 npm packages across several namespaces, plus the PyPI packages guardrails-ai 0.10.1 and mistralai 2.4.6.

Indicators of compromise

  • File router_init.js in the package root, SHA-256 ab4fcadaec49c03278063dd269ea5eef82d24f2124a8e15d7b90f2fa8601266c.
  • File tanstack_runner.js, SHA-256 2ec78d556d696e208927cc503d48e4b5eb56b31abc2870c2ed2e98d6be27fc96.
  • Dependency "@tanstack/setup": "github:tanstack/router#79ac49eedf774dd4b0cfa308722bc463cfe5885c" in optionalDependencies.
  • Domains filev2.getsession.org, seed1.getsession.org, seed2.getsession.org, seed3.getsession.org and git-tanstack.com.
  • Download URLs litter.catbox.moe/h8nc9u.js and litter.catbox.moe/7rrc6l.mjs.
  • Persistence files .claude/router_runtime.js, .claude/settings.json, .claude/setup.mjs, .vscode/setup.mjs and .vscode/tasks.json.
  • Daemon gh-token-monitor: ~/.local/bin/gh-token-monitor.sh and a systemd user service on Linux, or ~/Library/LaunchAgents/com.user.gh-token-monitor.plist on macOS.
  • Git commits authored as claude@users.noreply.github.com.
  • Advisory GHSA-g7cv-rxg3-hmpx and CVE-2026-45321.

How to check

Search the project folder for the payload file and the git dependency. The commands only read files.

find . -name router_init.js -exec shasum -a 256 {} +
grep -rl "79ac49eedf774dd4b0cfa308722bc463cfe5885c" node_modules package-lock.json pnpm-lock.yaml

Check for the persistence files and the daemon.

ls .claude/router_runtime.js .claude/setup.mjs .vscode/setup.mjs ~/.local/bin/gh-token-monitor.sh ~/Library/LaunchAgents/com.user.gh-token-monitor.plist

What to do now

  1. Stop the gh-token-monitor daemon and remove its files before you revoke any token.
  2. Remove the .claude and .vscode persistence files and revert any malicious commits.
  3. Rotate GitHub, npm, AWS, GCP, Vault, Kubernetes and SSH credentials that the machine or runner can read.
  4. Pin to a clean version. Block *.getsession.org and git-tanstack.com at the DNS or proxy level.

What Vigilance would show

These examples show an install hold and the corresponding owner report.

Example install message

Vigilance blocked `@tanstack/`. This version is too new or changed in a way Vigilance must check first.

Example owner report

Bad update

@tanstack/

The package gained a new hidden file that ran during install, collected build secrets and sent them away.

See what to do now.

No security team? See who reads the alert.

Frequently asked questions

Is it safe to install TanStack now?

TanStack states that every currently published version of every TanStack package is safe. The 84 malicious versions were deprecated and later removed from npm.

How can I lower the risk of this kind of attack?

Pin GitHub Actions to commit SHAs and restrict OIDC trusted publishing to a named workflow and branch. Snyk also suggests a package manager release-age delay of 7 days.

Sources

  1. tanstack.com/blog/npm-supply-chain-compromise-postmortem
  2. wiz.io/blog/mini-shai-hulud-strikes-again-tanstack-more-npm-packages-compromised
  3. snyk.io/blog/tanstack-npm-packages-compromised/

Send this page to the person who looks after AI at your company.

Email it

More supply chain attacks

All 172 attacks in the library · npm supply chain attacks · How to prevent supply chain attacks

Check the next update before you install it

Vigilance compares the version you trust with the new one. It names the one file that gained a power the old version did not have.

Start the free 14-day trialBrowse the attack library