Article 1
Postmortem: TanStack npm supply-chain compromise
TL;DR
An attacker successfully compromised 42 TanStack npm packages by chaining GitHub Actions cache poisoning with OIDC token extraction. The breach allowed for the unauthorized publication of malicious versions that could exfiltrate sensitive cloud and infrastructure credentials.
On May 11, 2026, the TanStack ecosystem experienced a significant supply-chain attack involving 84 malicious versions across 42 npm packages. The attack utilized a sophisticated chain of three vulnerabilities to bypass security boundaries. First, the attacker leveraged the pull_request_target GitHub Actions workflow pattern to execute code from a malicious fork. Second, the attacker poisoned the GitHub Actions cache by injecting malicious data into the pnpm-store directory during a benchmark job. This poisoned cache was subsequently restored during a legitimate release workflow on the main branch. Finally, the malicious payload, embedded within the restored cache, extracted an OIDC token from the runner process. Using this token, the attacker was able to use the trusted-publisher binding to publish malicious packages directly to the npm registry. The malicious script, router_init.js, was designed to harvest a wide array of credentials, including AWS IMDS, GCP metadata, Kubernetes service-account tokens, Vault tokens, and SSH private keys. These credentials were exfiltrated using the Session/Oxen messenger file-upload network. The attack was detected within 20 minutes by an external researcher, leading to the deprecation of all affected packages and the purging of poisoned cache entries. While no npm credentials were stolen, the developers recommend that any host that ran an affected version during the window of compromise be treated as compromised, necessitating a rotation of all reachable credentials.