Security

Shai-Hulud Hit Tensorlake's npm Package: How to Check Your Builds and Rotate Secrets Safely

A poisoned release of an AI sandbox SDK was live for hours. Here is how to find out whether it touched your machines, and why the order of your cleanup matters.

Paige Donnelly

Senior Backend Engineer

Published 7 min read
Dark-themed laptop setup with a red glowing keyboard and code on screen, ideal for tech enthusiasts.
On this page 8 sections

A Shai-Hulud variant was published inside tensorlake version 0.5.144 on npm on October 8, 2026. Its install script steals cloud, CI and browser credentials and can wipe a machine if a stolen token is revoked. If any system installed that version, treat it as compromised, disable the token monitor, then rotate every secret it could read.

Backtrace covers the security work that engineering teams actually do, and this incident is a clean example of why install-time code is a risk. This guide is for developers, DevOps engineers and platform leads who use npm. It covers what happened, how to check your exposure, how to clean up in a safe order and how to cut the odds of a repeat.

What Happened to the Tensorlake npm Package?

Two workers handle a package in a spacious warehouse surrounded by shelves stocked with boxes and products.

An attacker published a poisoned release of Tensorlake's npm SDK after gaining control of a maintainer's identity. According to Aikido Security's analysis, the actor made verified commits under a maintainer's identity on October 7 and added the malicious code by direct file upload. The poisoned version reached npm on October 8, about 20 hours after the repository was compromised.

Socket flagged the release 11 minutes after publication. npm removed the version, and Tensorlake published 0.5.145 as a clean replacement. The Register's report says the package gets about 12,000 downloads a week and that the full impact is unknown. Aikido cites a much higher lifetime install count, so exposure estimates vary.

The Register adds that the code shares techniques with the ChainDrop variant used in August against packages such as keyv and flat-cache. This is a known family, not a new one.

How Does This Shai-Hulud Variant Work?

It runs when you install the package, not when you import it. A preinstall script launches a setup file that installs the Bun runtime and then runs a second payload with it. That is why a plain install on a laptop or a build server is enough.

A classic MS-DOS terminal screen displayed on a laptop keyboard with vivid illumination.

The payload harvests environment variables and local secrets, mainly cloud, CI, Kubernetes and Vault credentials. It also reads credential files such as SSH keys and cloud configs. Unlike earlier waves, Aikido says it targets 14 cryptocurrency wallet browser extensions and downloads a tool to pull saved logins from browsers.

Socket's warning explains the stakes: code executed during installation inherits the permissions of the installing process. A build agent with deploy keys hands those keys to the attacker.

The nastiest feature is the dead-man's switch. The malware monitors stolen GitHub tokens. If one is revoked, it can delete data on the infected machine. Researchers advise disabling the token monitor before revoking credentials.

How Do You Check Whether You Were Exposed?

Search your lockfiles, CI logs and caches for the bad version. Start with the repositories that use Tensorlake directly, then check transitive dependencies. Work through these checks in order:

  1. Run npm ls tensorlake in each project and read the resolved version.
  2. Search every package-lock.json, yarn.lock and pnpm-lock.yaml for tensorlake and the string 0.5.144.
  3. Check CI install logs from October 8 onward for that version, including scheduled and bot-triggered builds.
  4. Check developer machines and shared build caches, not just pipelines.
  5. Look for the indicators Aikido published, including the file lib/Math_Symbol.js and the domain iseekaigogo[.]com.

Developer laptops and CI runners fail differently. A laptop usually holds personal cloud profiles, SSH keys and browser logins, so the exposure is broad but one person wide. A shared runner may hold deploy keys for many services, so one install can reach a lot of systems at once. Prioritize shared runners and release machines first, then work down to individual laptops.

A match on 0.5.145 or later is not an infection. A match on 0.5.144 means the install script may have run. If you cannot prove it did not, assume it did.

Outbound network logs help too. Any request to the listed command-and-control domain from a build host is a strong signal. Our guide on secrets scanning tools can help you find what was exposed on affected systems.

What Is the Safe Order for Cleanup?

Contain first, rebuild second and rotate third, with token revocation last. Doing it out of order can trigger the wipe or leave the attacker with live keys. Socket recommends rebuilding compromised systems from a trusted source before restoring access to secrets.

Chain-locked book, phone, and laptop symbolizing digital and intellectual security.

Follow this sequence for each affected machine or runner:

  1. Isolate the system from the network and from your secret stores.
  2. Stop any process that watches for token revocation, following your security vendor's guidance.
  3. Snapshot or copy logs you need for the investigation.
  4. Rebuild from a known-good image; do not clean in place.
  5. Rotate every credential the system could read, starting with cloud and CI tokens.
  6. Review audit logs for use of those credentials since October 8.

The rotation list is long on purpose. Cloud keys, GitHub and package registry tokens, SSH keys, Kubernetes and Vault tokens, and any .env contents all count. Our API key rotation guide covers how to do this without breaking production.

Do not forget secrets that live outside code. Shared password vaults, chat bots and deployment dashboards often hold copies of the same keys. If a stolen credential was also pasted into one of those places, rotating only the original leaves a working copy behind.

Document what you did and when. If an auditor or customer asks, a written timeline is worth more than good memory.

How Can You Reduce Install-Time Risk Going Forward?

Stop dependencies from running code on install unless you approve it. Setting ignore-scripts to true in npm blocks lifecycle scripts like preinstall for packages you pull in. Recent versions of pnpm also block dependency lifecycle scripts by default and let you allow specific packages.

Detailed view of network cables plugged into a server rack in a data center.

A few controls add up. Use exact versions and lockfiles, and review lockfile changes in pull requests. Delay adoption of brand-new releases with a minimum release age setting where your package manager supports it, since most poisoned versions are caught within hours.

Give CI the least access it needs. A build runner should not hold production deploy keys. Short-lived, scoped tokens limit what a stolen environment can do. Our overview of software supply chain attacks explains the wider pattern.

AI tooling adds new routes in. The Tensorlake SDK exists to run untrusted, AI-generated code in sandboxes. A sandbox does not help if the SDK's own install step runs outside it. We looked at a related risk in hallucinated dependencies.

What This Incident Says About Maintainer Account Security

The weak point was not the registry but the people and pipelines around the package. Verified commits under a real maintainer's identity suggest the attacker held valid credentials or a signing key. The code went in by direct file upload, which bypasses the normal review a pull request would trigger.

That matters for anyone who publishes packages, including internal ones. Protect publishing rights with hardware-backed multi-factor authentication. Require review for changes to release scripts. Limit who can bump a version and trigger a publish, and alert when a release happens outside normal hours.

Consumers can add a check of their own. A new release from a package you depend on that appears right after unusual repository activity deserves a delay. Waiting a day for most dependency updates costs little, and it would have avoided this one entirely for teams that pinned versions.

Aikido's own timeline also shows how quickly detection can work. Socket flagged the release 11 minutes after publication. The gap between flagging and your install is the part you control, which is why automated scanning at install time, not only in a weekly report, is worth the setup.

What Should Your Team Practice Before the Next One?

Rehearse the response before you need it. Pick a pretend compromised package and run the checks above on a test project. Time how long it takes to list affected builds and to rotate a key.

A high-tech command center with illuminated digital screens in a futuristic setting.

Write the steps into your runbook. Our guide to building an incident response runbook shows a format that on-call engineers will actually follow. Include the warning about token revocation order in bold at the top.

Our read at Backtrace is that the dead-man's switch changes the calculus. Fast revocation used to be the safest move. Against this family of malware, it can make things worse, so the first step is containment and a calm look at what is running.

Conclusion

The Tensorlake compromise was caught in minutes and removed quickly, but any machine that installed 0.5.144 should be treated as breached. Check lockfiles and logs, contain and rebuild, then rotate secrets in the right order. Blocking install scripts by default is the single best change you can make this week.

Start with one search: find every repository and CI job that resolved tensorlake on or after October 8. Backtrace will keep covering supply chain incidents as they develop.

Which Tensorlake version was compromised?
Only tensorlake version 0.5.144 on npm is reported as compromised. It was published on October 8, 2026, and later removed by npm. Tensorlake released 0.5.145 as a clean replacement. Aikido reported no sign of compromise in the PyPI or Cargo packages, though that could change as researchers continue their analysis.
What does the Shai-Hulud malware in Tensorlake steal?
It harvests environment variables and local secrets, mainly cloud, CI, Kubernetes and Vault credentials, plus SSH keys, cloud configuration files and wallet files. Aikido says this variant also targets 14 cryptocurrency wallet browser extensions and downloads a tool to pull saved credentials from browsers.
Should I revoke my GitHub tokens immediately after an infection?
Not before containing the machine. The malware monitors stolen GitHub tokens and can wipe data on the infected system if one is revoked. Researchers advise disabling the token monitor first. Isolate the system, follow your security vendor's guidance, rebuild from a trusted source, and then rotate credentials.
How can I stop npm packages from running code on install?
Set ignore-scripts to true in your npm configuration to block lifecycle scripts such as preinstall for dependencies. Recent versions of pnpm block dependency lifecycle scripts by default and allow approved exceptions. Pair that with lockfiles, exact versions and a minimum release age so brand-new releases are not installed immediately.

Written by

Paige Donnelly

Senior Backend Engineer

8+ years experience

Paige Donnelly is a senior backend engineer who has spent the last eight years working on distributed systems, first at a mid-size fintech and then leading a payments infrastructure team through a migration from a monolith to event-driven services. She's on the losing end of more 3am pages than she'd like to admit, which is why she writes about observability, deployment safety, and API design with an eye toward what actually breaks in production rather than what looks good in a conference talk. She contributes to a couple of open-source CLI tools in her spare time and still refuses to use a debugger for anything she can solve with well-placed logs.

Credentials

  • 8 years in backend and distributed systems engineering
  • Former tech lead, payments infrastructure at a Series D fintech
  • Contributor to several open-source developer tooling projects