Zscaler ThreatLabz identified a malicious npm supply chain campaign in November 2025 involving three related packages: bitcoin-main-lib, bitcoin-lib-js, and bip40. The first two packages function as wrappers and execute a postinstall.cjs script during installation. This script ultimately installs and launches bip40, which contains the actual malware payload. The final implant, designated NodeCordRAT by Zscaler ThreatLabz, is a Node.js–based remote access trojan with credential theft and remote command execution capabilities.While bip40 is commonly delivered via the wrapper packages, it is also available as a standalone npm package, allowing the attacker to bypass the staged installation entirely. To deceive developers, the threat actor relied on naming conventions that closely resemble legitimate repositories in the bitcoinjs ecosystem, exploiting familiarity with widely used Bitcoin-related libraries.
NodeCordRAT uses Discord for command-and-control. Upon execution, the malware performs host fingerprinting to generate a unique identifier for each infected system, combining the operating system type with a truncated machine-specific value (for example, win32-c5a3f1b4). On Windows, this identifier is derived from the system UUID using WMI or PowerShell queries, while on Linux and macOS it is obtained from files such as /etc/machine-id or platform-specific commands like ioreg.
The infection chain is intentionally layered to obscure the true payload. When a developer installs bitcoin-main-lib or bitcoin-lib-js from npm, the postinstall.cjs script attempts to resolve and execute bip40. The script launches bip40 via Process Manager 2 (PM2), dynamically resolving the PM2 binary path based on the operating system and running the payload in detached mode. This ensures that NodeCordRAT continues executing after the installation process completes and will be restarted by PM2 if it crashes during the same session. No user interaction is required at any stage. If PM2 is not present, the script logs a warning and exits without launching the malware.
To increase credibility, each malicious package includes a package.json file referencing the legitimate bitcoinjs project. All three packages were uploaded by the same npm author account and accumulated several thousand downloads before removal, with bitcoin-main-lib accounting for the majority.
Once active, NodeCordRAT performs data theft and exfiltration through Discord’s API. The malware targets Google Chrome credential stores by collecting the Login Data SQLite databases and the Local State file, recursively searches user home directories for files containing “.env” to harvest developer secrets such as API tokens, and locates MetaMask wallet data by identifying LevelDB (.ldb) files associated with the MetaMask Chrome extension. Exfiltration is performed by uploading the stolen files as attachments to a private Discord channel using a hardcoded API token. Before transmission, the malware verifies file existence and size and reports any upload failures back to the operator with explicit error messages.
Although the malicious packages have been removed from npm, this campaign highlights how modestly obfuscated post-install scripts, trusted ecosystem naming, and legitimate third-party services can be combined to deliver effective supply chain malware with minimal user interaction.