Malicious npm Package Impersonating TanStack Steals Environment Files

· Original article ↗

Summary

Malicious versions 2.0.4–2.0.7 of the unscoped npm package tanstack used postinstall scripts to exfiltrate environment files and, in some versions, README.md or AGENTS.md. Developers who installed them should rotate secrets.

Key points

  • Versions 2.0.4 through 2.0.7 were confirmed malicious and published within 27 minutes.
  • The unscoped tanstack package is not affiliated with the official @tanstack/* projects.
  • An npm postinstall hook collected environment files and sent them to an attacker-controlled Svix endpoint.
  • Version 2.0.6 targeted .env and .env.* files; other versions also targeted README.md or AGENTS.md.
  • The attack ran silently in some versions, and the same Svix source ID appeared across all four releases.
  • Anyone who installed an affected version should remove it and rotate secrets that may have been present at install time.
  • The article also recommends blocking the unscoped package and monitoring outbound traffic to api.svix.com.

Article Details

Attack Vectors
  • Unscoped npm package tanstack versions 2.0.4–2.0.7 used a postinstall lifecycle hook to silently collect and exfiltrate environment files from developer machines.
  • Version 2.0.6 collected files matching .env and .env.* from the install root; other affected versions targeted specified environment files, and some versions also exfiltrated README.md or AGENTS.md.
  • Collected data was sent by HTTPS POST to a Svix ingest URL. The article says the same Svix source ID appeared across all four malicious versions.
Defensive Notes
  • If versions 2.0.4–2.0.7 were installed, uninstall the package and rotate secrets that may have been present in project environment files.
  • Audit package.json, package-lock.json, and yarn.lock for the unscoped tanstack package; the article identifies @tanstack/* as the legitimate package scope.
  • Consider adding unscoped tanstack to registry deny lists or package-firewall policies.
  • Monitor for suspicious outbound traffic to api.svix.com from CI/CD pipelines, developer machines, and container build environments.

Indicators of compromise

TypeIndicatorContext
URLhxxps[:]//api[.]svix[.]com/ingest/api/v1/source/src_3387PLMB2uhXOBe3Q8sHu/Exfiltration URL identified by the article as the malicious package's Svix drop box.

MITRE ATT&CK

People

Products

Industries

Related Articles