TL;DR: A fake tanstack npm package published four rapid-fire versions in 27 minutes to steal .env files through a postinstall hook, routing exfiltrated secrets via a trusted webhook relay and exposing developers and CI pipelines to credential theft, according to Aikido. The incident shows how package install trust, not just vulnerability exploits, can turn routine dependency workflows into secret-harvesting events.
NHIMG editorial — based on content published by Aikido: Someone published four versions of a fake tanstack package in 27 minutes to steal your .env files
Questions worth separating out
Q: What breaks when a compromised package can read secrets during installation?
A: The main failure is that package installation becomes an identity event.
Q: Why do .env files create so much risk in modern development pipelines?
A: .env files concentrate high-value credentials in a predictable location that many tools and packages can access during normal work.
Q: How do security teams detect package-based data exfiltration in practice?
A: Look for linked signals across process, file, and network telemetry.
Practitioner guidance
- Block automatic execution of install scripts Disable or tightly control postinstall execution in developer and CI workflows where feasible, and require explicit review for packages that need lifecycle hooks.
- Move credentials out of local environment files Reduce reliance on .env and .env.local for long-lived secrets.
- Monitor package install egress and file reads Correlate package install events with outbound HTTPS traffic and local reads of .env, .env.local, and similar files.
What's in the full analysis
Aikido's full post covers the operational detail this post intentionally leaves for the source:
- Version-by-version malware diff showing how the payload changed across 2.0.4 to 2.0.7.
- Indicators of compromise, including package hashes and the exfiltration endpoint details.
- Step-by-step verification commands for package-lock files, node_modules checks, and CI log review.
- Detection and remediation guidance for teams that need to assess whether .env files were exposed.
👉 Read Aikido's analysis of the fake tanstack npm package and .env theft →
Fake tanstack npm package exfiltrates .env files on install?
Explore further
Package-install trust is now a credential boundary, not just a software-delivery detail. This incident shows that dependency installation can execute code with access to local files, environment variables, and CI secrets. That collapses the old assumption that package managers are only distribution tools. For identity teams, the relevant control question is who is allowed to execute install-time code with access to credentials, not just what code is approved.
A few things that frame the scale:
- The average estimated time to remediate a leaked secret is 27 days, despite 75% of organisations expressing strong confidence in their secrets management capabilities, according to The State of Secrets in AppSec.
- Only 44% of developers are reported to follow security best practices for secrets management, exposing a significant developer behaviour gap, according to The State of Secrets in AppSec.
A question worth separating out:
Q: Who is accountable when a compromised package exposes cloud or developer secrets?
A: Accountability sits with the teams that own maintainer credential governance, release controls, CI/CD hardening, and secret rotation. If a compromised dependency touched systems with sensitive credentials, the response must include revocation, reconstruction, and post-incident access review. Software supply chain incidents are identity incidents, not just build failures.
👉 Read our full editorial: Fake tanstack npm package turns installs into .env exfiltration