# TanStack npm compromise: 84 versions of 42 @tanstack packages stole cloud, GitHub and SSH credentials

Source: https://botpassword.com/incidents/2026-05-tanstack-npm-mini-shai-hulud
Disclosed: 2026-05-11 · Type: Supply chain · Status: Resolved · Updated: 2026-10-25

On 11 May 2026 between about 19:20 and 19:26 UTC an attacker published 84 malicious versions of 42 `@tanstack/*` npm packages through TanStack's own GitHub Actions trusted-publisher identity, after poisoning the CI cache from a fork pull request. The install-time payload stole AWS, Google Cloud, Kubernetes, Vault, npm, GitHub and SSH credentials and republished other packages its victims maintained. Anyone who installed an affected version that day should treat the host as compromised and rotate those credentials. OpenAI said two employee devices were hit.

Identifiers: CVE-2026-45321, GHSA-g7cv-rxg3-hmpx

## What was exposed

TanStack's postmortem says the payload, an obfuscated `router_init.js` of about 2.3 MB run from a `prepare` script, harvested AWS instance metadata and Secrets Manager values, Google Cloud metadata credentials, Kubernetes service-account tokens, Vault tokens, `~/.npmrc`, GitHub tokens (from the environment, the `gh` CLI and `.git-credentials`) and SSH private keys. In CI it dumped the runner's memory to extract an OIDC token and used it to publish to npm. Data went out over the Session/Oxen file network rather than an attacker server. It also listed other npm packages the victim maintained and republished them with the same injection. TanStack says no npm token of its own was stolen; the publishes used its legitimate OIDC binding. In a post published in mid-May, OpenAI said two employee devices in its corporate environment were affected and the malware took limited credential material from a subset of internal repositories; it said it found no evidence that user data, production systems or customer passwords and API keys were affected. It rotated credentials, revoked sessions, rotated code-signing certificates held in the affected repositories, and asked macOS users to update its apps.

## Who is affected

You are affected if any machine or CI job installed one of the exact versions listed in GHSA-g7cv-rxg3-hmpx on 11 May 2026, directly or as a transitive dependency (each affected package received exactly two malicious versions; the advisory lists, for example, `@tanstack/react-router` 1.169.5 and `@tanstack/router-core` 1.169.5). TanStack's Query, Table, Form and other families were not listed. Check lockfiles against the advisory, and look for a `router_init.js` at a package root or an `optionalDependencies` entry named `@tanstack/setup` pointing at a GitHub commit.

## What to do

1. Compare your lockfiles with the per-package versions in GHSA-g7cv-rxg3-hmpx and upgrade to the patched versions it lists.
2. On any host that installed an affected version, rotate AWS, Google Cloud, Kubernetes, Vault, GitHub, npm and SSH credentials.
3. If you maintain npm packages, check them for versions you did not publish.
4. Block `filev2.getsession.org` and `seed1` to `seed3.getsession.org` from build systems.
5. Avoid `pull_request_target` workflows that run fork code, and do not share caches across the fork and base trust boundary.

## Keys to rotate

- [AWS (IAM access keys)](https://botpassword.com/keys/aws)
- [Google Cloud (service account keys and API keys)](https://botpassword.com/keys/google-cloud)
- [GitHub](https://botpassword.com/keys/github)
- [npm](https://botpassword.com/keys/npm)

## Timeline

- 2026-05-10: The attacker creates a renamed fork of TanStack/router and pushes a payload commit under a forged `claude` identity, per TanStack's postmortem. ([source](https://tanstack.com/blog/npm-supply-chain-compromise-postmortem))
- 2026-05-11: A fork pull request triggers a `pull_request_target` workflow that saves a poisoned pnpm cache. At 19:15 UTC a release run restores it; malicious publishes land at 19:20 and 19:26 UTC. A StepSecurity researcher opens issue #7383 at 19:46 UTC, and deprecations and npm takedowns follow that evening. ([source](https://tanstack.com/blog/npm-supply-chain-compromise-postmortem))
- 2026-05-12: GitHub publishes GHSA-g7cv-rxg3-hmpx (critical) and NVD records CVE-2026-45321, listing per-package affected and patched versions. ([source](https://github.com/TanStack/router/security/advisories/GHSA-g7cv-rxg3-hmpx))
- 2026-05-18: Nx reports that a contributor machine infected by `@tanstack/zod-adapter@1.166.15` led to a malicious Nx Console extension release. ([source](https://nx.dev/blog/nx-console-v18-95-0-postmortem))

## Indicators

- `router_init.js` (about 2.3 MB) at the package root; `optionalDependencies` entry `@tanstack/setup` pointing to `github:tanstack/router#79ac49ee...`.
- Exfiltration to `filev2.getsession.org` and `seed1.getsession.org`, `seed2.getsession.org`, `seed3.getsession.org`; second stage from `litter.catbox.moe`.
- Commits authored as `claude <claude@users.noreply.github.com>`; attacker accounts `zblgg` and `voicproducoes`.

## Sources

- https://tanstack.com/blog/npm-supply-chain-compromise-postmortem
- https://github.com/TanStack/router/security/advisories/GHSA-g7cv-rxg3-hmpx
- https://nvd.nist.gov/vuln/detail/CVE-2026-45321
- https://github.com/TanStack/router/issues/7383
- https://openai.com/index/our-response-to-the-tanstack-npm-supply-chain-attack/
