Emergency: 84 TanStack npm Packages Compromised in Global Supply Chain Attack
On the morning of May 12, 2026, security researchers at **Socket** and **Snyk** identified a sophisticated supply chain attack targeting the **TanStack** ecosystem. A total of **84 packages**, including popular libraries like **TanStack Query (React Query)**, **TanStack Table**, and **TanStack Router**, were found to contain malicious post-install scripts designed to exfiltrate CI/CD environment variables.
Technical Breakdown: The Credential Exfiltration
The malicious payload was hidden within a dependency-confusion exploit targeting the `@tanstack/` scope. The scripts specifically searched for variables matching `GITHUB_TOKEN`, `NPM_TOKEN`, and `AWS_SECRET_ACCESS_KEY`. Once found, these secrets were base64 encoded and sent to a remote telemetry server masked as a legitimate performance-monitoring endpoint.
- Attack Vector: Compromised maintainer account via a session-hijacking exploit on a legacy npm registry mirror.
- Impact: Potentially affects millions of active CI/CD pipelines running `npm install` between 02:00 and 06:30 UTC.
- Affected Versions: All TanStack packages released in the last 24 hours.
CRITICAL REMEDIATION STEPS
1. **Rotate all CI/CD secrets** immediately if your pipeline ran during the window.
2. Force a clean cache and reinstall packages with `npm cache clean --force`.
3. Verify your `package-lock.json` for unauthorized dependency changes in the `@tanstack/` namespace.
Official Response and Patching
Tanner Linsley, the creator of TanStack, has confirmed that the compromised accounts have been secured and the malicious versions have been yanked from the npm registry. New, verified versions are being rolled out with Subresource Integrity (SRI) hashes to prevent future tampering.
Long-Term Implications for OSS Security
This incident underscores the fragility of the modern web ecosystem. Even high-trust libraries with rigorous maintainer standards are vulnerable to session hijacking. Industry leaders are calling for a mandatory shift toward **OIDC-based publishing** and hardware-backed MFA for all package maintainers across npm and PyPI.