Hackers have compromised the TensorLake npm package to spread credential-stealing malware as part of the Shai-Hulud supply chain attack.
TensorLake provides isolated sandboxes for running untrusted, LLM-generated code, with its npm SDK allowing developers to create and manage those environments from TypeScript applications. The package receives about 12,000 weekly downloads, according to Socket.
Once a victim installs the compromised version, the package runs credential-stealing malware, which establishes persistence and executes remotely supplied code, security firm Socket Security, which uncovered the latest campaign, said on Thursday.
“A compromised SDK creates exposure on the machine installing it, before generated code reaches a sandbox,” Socket Security said.
Part of a wider supply chain campaign
Shai-Hulud is a worm with autonomous replication capability that targets npm packages and continuously seeks out additional packages to compromise more victims, leading to large-scale supply chain compromises.
In August, Microsoft reported that hackers had infected more than 400 packages across multiple unrelated npm publishers. Previously, attackers compromised 323 packages in the @antv npm ecosystem, with over 16 million combined weekly downloads.
The latest campaign appears to be linked to the August campaign that compromised keyv, cacheable, and related npm packages, in which a loader executes a Math_Symbol.js payload to spread to other packages, Socket Security said.
“Socket’s initial assessment identifies credential harvesting across local files, CI environments, Kubernetes, and Vault sources,” the researchers said. “The malicious code also exfiltrates collected data, establishes persistence, and supports execution of remotely supplied code.”
To respond to a potential compromise, Socket Security recommends that users block the affected version, identify environments where its installation scripts ran, and isolate affected hosts.
Users should then remove the malware’s token monitor before revoking and replacing exposed credentials, Socket said, as revoking the stolen GitHub token while the monitor is still running triggers a dead-man switch that wipes the user’s home directory.