- Affected release: [email protected] carried a Shai-Hulud credential-stealing worm, while 0.5.143 and earlier were reported clean.
- Trusted pipeline: the package came from the project’s own GitHub Actions release process and had valid provenance, which only confirmed build origin.
- Stolen secrets: the malware targeted npm and GitHub tokens, cloud keys, SSH keys, Vault and Kubernetes credentials, browser logins and AI tool configs.
- Dangerous cleanup: a token watcher could wipe the home directory if the stolen GitHub token was revoked before the monitor was removed.
The npm distribution of Tensorlake’s TypeScript SDK became the center of a supply-chain security scramble after researchers found malicious code in release 0.5.144. The package is used to create and manage isolated environments for AI agents, and public metrics cited in coverage put it at roughly 12,000 weekly downloads, with its GitHub project drawing more than a thousand stars. Security vendors said the bad build appeared online briefly before the registry and the maintainers removed it, and a later version, 0.5.145, was prepared as a replacement. Version 0.5.144 was the affected release.
What makes the episode stand out is not just the payload, but the path it took. According to reports from StepSecurity and Socket, the harmful files were committed to the project’s main branch and then published through the repository’s normal GitHub Actions release workflow. That workflow produced a valid npm provenance attestation, which can make the package look trustworthy because provenance shows where a build came from. It does not prove that the source code itself was safe. Valid provenance did not mean the package was clean.
What the infected package did
Analysts said the malicious version added a preinstall step to the package manifest, causing Node.js to run an obfuscated loader during installation. That loader, identified as lib/setup.mjs, reportedly pulled in the Bun runtime and launched a much larger obfuscated payload, lib/Math_Symbol.js, which was about 856 KB. The code checked environment variables associated with CI systems, and some write-ups said it avoided certain automated runner settings while focusing on developer workstations. Other warnings stressed that install scripts can still execute on build servers or application hosts if the package is installed there. Install-time execution was the first stage of the attack.
The payload was linked to the Shai-Hulud credential-stealing worm family. Researchers said it hunted for a wide range of secrets: npm and GitHub tokens, cloud credentials for AWS, GCP and Azure, Kubernetes and Docker configuration, HashiCorp Vault tokens, SSH keys, browser-saved logins, environment files such as .env, GitHub Actions secrets and configuration for AI coding tools including Claude, Cursor and Windsurf. Some coverage also mentioned crypto wallets and service-account tokens. After collection, the data was encrypted and sent either to a public repository created in the victim’s GitHub account or to an external command-and-control domain. The stolen material covered both developer and cloud access.
How it tried to spread
Once the worm had an npm token, it could query the victim’s published packages, insert itself into them, raise their version numbers and push the modified packages back to the registry. With a GitHub token, it could commit two files into repositories the token could reach: .claude/settings.json and .vscode/tasks.json. Those files were designed to run the malware again when someone opened the affected project in Claude Code or Visual Studio Code. The commits used a fake author address, [email protected], and a routine-looking message about updating dependencies. Opening a poisoned project in an AI tool could restart the infection.
Security researchers also described a ‘hostage token’ mechanism. When the malware obtained a GitHub token, it installed a small watcher called gh-token-monitor. The watcher checked the token against GitHub’s API every minute for up to 24 hours. If GitHub rejected the token, the watcher could run a destructive command, such as deleting the user’s home directory on Linux or macOS, or removing the Windows profile through PowerShell. That detail changed the usual incident response order: people were warned not to revoke the stolen GitHub token until the monitoring service had been found and disabled. Revoking the token first could trigger data loss.
Timeline and affected versions
StepSecurity reported that the first malicious commit reached tensorlakeai/tensorlake’s main branch at 01:20 UTC on October 7, 2026, under a maintainer’s name. Seven more commits followed over the next few hours, adjusting the payload and adding the preinstall instruction to package.json. None of those changes went through a pull request, according to the report. On October 8 at 01:12 UTC, the repository’s release workflow published version 0.5.144 to npm, and the files in the registry package matched the files on main. The release flowed through the project’s own automation.
The affected release was [email protected]. Six companion platform binary packages, named tensorlake-native-*@0.5.144, were published from the same run; analysts said they contained native binaries and no install script, and no payload was found in them, but they were still treated as part of the compromised release. Version 0.5.143 and earlier did not contain the preinstall step or the malicious files. Initially, 0.5.144 could still be downloaded when one report checked; later updates said npm removed it and Tensorlake pulled the package and moved to 0.5.145. 0.5.143 was identified as the last clean version.
Cleanup without setting off the trap
Response guidance converged on one key point: do not revoke a GitHub token until the gh-token-monitor service has been removed. After that, rotate everything the machine could have exposed. A practical sequence is:
- Check for exposure. Run npm ls tensorlake and inspect lockfiles for 0.5.144. Also check whether the tensorlakeai/tensorlake main branch was cloned or pulled since October 7 and whether npm install was run in the typescript/ directory.
- Stop using the bad version. Pin tensorlake to 0.5.143, delete node_modules, and clear the npm cache with npm cache clean –force. Setting ignore-scripts=true in .npmrc can prevent install hooks like the one used here. Maintainers later provided 0.5.145 as an updated release.
- Disable the token watcher. Look for ~/.config/gh-token-monitor/. If it exists, inspect the token file to see which GitHub credential it holds, then stop the service. On Linux, disable and remove the user systemd service and related files. On macOS, boot out the launch agent and delete the plist and related files. On Windows, check Task Scheduler for a logon task running a monitor.ps1 script and remove it.
- Rotate credentials. Only after the watcher is gone should the stolen GitHub token be revoked. Then replace npm tokens, cloud keys, SSH keys, Kubernetes and Vault credentials, .env secrets, AI tool keys and browser-saved passwords.
- Look for spread. Check for new public repositories with the description ‘Shai-Hulud: Here We Go Again’, commits from [email protected], and unexpected .claude or .vscode files.
- Rebuild if unsure. If the machine cannot be confirmed clean, wipe it and reinstall from trusted media or images.
For environments where the package only appeared in CI, the loader may have skipped itself, but analysts still advised rotating any secrets that job could see. The safe assumption is that any credential visible to the installing process may have been copied. Treat exposed secrets as compromised until replaced.
Indicators and detection notes
Security teams published several indicators to help with hunting and verification. They included:
- Package: [email protected] on npm.
- File hashes: lib/setup.mjs — 25a0735d0db7dc40e5d45ce42d9c106067e6a66e184d967cfecfab17c3bcb5ef; lib/Math_Symbol.js — b50a00900399ba99fb6ce1fc151519cb99d44320ef2a631f2237e1aea0ad6fec.
- Network: iseekaigogo[.]com, plus GitHub and npm APIs used for credential checks and propagation. An Ethereum resolver wallet, 0xb614155Fd88114d40549b259457Bcf921Df091B9, was reported as an on-chain dead drop for the current C2 domain.
- GitHub traces: a public repository description reading ‘Shai-Hulud: Here We Go Again’, commits authored by [email protected], and the source repository at github.com/tensorlakeai/tensorlake. The first malicious commit was e90c47bbb2; the release run was linked in reports.
- Local files: ~/.config/gh-token-monitor/ and ~/.local/bin/gh-token-monitor.sh. The malware also probes internal cloud metadata endpoints such as 169.254.169.254 and 169.254.170.2, and local Vault at 127.0.0.1:8200.
Enterprise security tools moved quickly to flag the version. StepSecurity said its AI Package Analyst detected the release and that the incident was reported to maintainers through GitHub issue #1014. Its Threat Center published an alert with affected versions, IOCs and triage steps, and Secure Registry blocked [email protected] by default. The company also noted that policies which trust npm provenance alone would not have stopped this package, because the attestation was valid. Detection had to look at the package contents, not just its signature trail.
Why this matters for supply-chain security
The Tensorlake case shows how quickly a trusted publishing path can become a delivery vehicle. A maintainer account or token appears to have been abused, and the project’s own release automation did the rest. The worm then tried to turn one victim’s npm and GitHub access into a broader campaign, while planting persistence in editor and AI-agent configuration files. Because the package is an SDK for running AI agents and untrusted code, the compromise also blurred the line between the sandboxed workload and the developer or build machine installing the SDK. One bad release can expose far more than a single project.
Researchers compared the code to the ChainDrop variant of Shai-Hulud, which was used in August to compromise npm dependencies such as keyv and flat-cache. That comparison does not mean every detail was identical, but it puts the Tensorlake incident in a known pattern of credential theft, self-propagation and destructive leverage. Coverage from StepSecurity, Socket, SafeDep and others broadly agreed on the core facts: the malicious version was 0.5.144, it used an install hook, it stole credentials, it tried to spread through tokens, and it included a trap around GitHub token revocation. The main disagreement was only about how long the package stayed available and how to sequence cleanup.
For anyone who may have installed 0.5.144, the practical takeaway is to verify first, disable the token monitor before revoking the GitHub token, then rotate every secret the host could reach. Check repositories for unexpected commits and configuration files, and rebuild systems if there is any doubt about their cleanliness. Tensorlake users should avoid the bad version, prefer a known-good release such as 0.5.143 or the later 0.5.145 after confirming its integrity, and keep install scripts disabled where possible. The response order matters as much as the cleanup itself.
