TanStack, a provider of widely used open-source web development tools, has confirmed an npm supply-chain compromise affecting packages with a combined 5 million weekly downloads, according to an official postmortem published by the project.
How the attack unfolded
Per TanStack's postmortem, the breach originated from a compromised npm account belonging to a former, inactive team member. The attacker used this access to publish malicious versions of several widely-used TanStack packages. The injected code was designed to exfiltrate environment variables — which often contain API keys, credentials, and other secrets — from developer machines that installed the compromised versions.
TanStack says it revoked the compromised credentials, removed the malicious packages from the npm registry, and worked with security teams to analyze the payload. The incident highlights the risk of inactive accounts retaining publishing permissions on widely depended-upon projects.
Why it matters
The attack targeted some of TanStack's most-used packages, and although the malicious versions were live only briefly, their reach means many downstream projects could have pulled them during that window. Because environment variables frequently store cloud credentials, database connection strings, and API keys, this type of exfiltration can extend well beyond a single project — including into AI and machine learning pipelines that depend on npm packages as part of their tooling.
TanStack's postmortem points to standard mitigations: enforcing multi-factor authentication on all maintainer accounts, auditing publishing permissions regularly, and using dependency and package-integrity scanning to catch tampered releases before they reach production.