Skip to content
supplychainattack.orgSupply chain attack incident catalog
resolvedcritical

Malicious code in cryptostock (npm)

The npm package cryptostock contained obfuscated malicious code that, when required, established a C2 connection to badai.run.place, harvested private keys and wallet credentials from the system, and automatically drained Ethereum accounts to a hardcoded address.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
Any developer or system that installed the malicious cryptostock npm package and required it in their code; systems with SSH keys, wallet keys, Ethereum keystores, or ETH_PRIVATE_KEY environment variables were at risk of credential theft and fund theft.
Ecosystems
Attack vectors
Affected entities
  • cryptostocknpm package containing obfuscated malicious payload

The npm package cryptostock was published with obfuscated malicious code in its index.js file. Upon being required in a Node.js application, the code initiated a command-and-control (C2) client connection to https://badai.run.place, registering a unique identifier and entering a long-polling loop to receive shell commands from the attacker.\n\nThe malware executed arbitrary commands via child_process.exec and exfiltrated output back to the C2 server using AES-256-ECB encryption. After a randomized 2–8 minute delay, it systematically enumerated sensitive directories containing cryptographic material, including SSH keys (/root/.ssh, /home/*/.ssh), wallet keys (/opt/wallet-keys), SSL certificates (/etc/ssl/private), Ethereum keystores (~/.ethereum/keystore, /var/lib/ethereum/keystore, /mnt/crypto/wallets), and the ETH_PRIVATE_KEY environment variable.\n\nFor each harvested Ethereum private key (identified by the 'PRIVATE KEY' marker), the malware instantiated a web3 connection to Infura mainnet and automatically broadcast signed transactions to drain the account balance (minus gas fees) to a hardcoded attacker-controlled address. Strings including module names, the C2 host, and keystore paths were base64-encoded in a string table and decoded at runtime to evade detection.\n\nThe malicious code was identified and credited to the OpenSSF's malicious-packages repository, indicating the incident has been documented and the package removed from npm.

Indicators of compromise

Packages
  • cryptostock
Domains
  • badai.run.place

Remediation

  • Immediately uninstall the cryptostock npm package from all systems and projects
  • Audit npm package.json and lock files for any installations of cryptostock
  • Rotate all SSH keys, SSL certificates, and Ethereum private keys that may have been exposed
  • Review Ethereum account transaction history for unauthorized transfers and report to relevant authorities
  • Scan systems for the presence of the malicious index.js file and remove it
  • Monitor ETH_PRIVATE_KEY environment variables and any wallet keystores for unauthorized access
  • Implement npm package integrity verification and use npm audit to detect malicious packages
  • Review C2 logs and network traffic to badai.run.place for evidence of compromise

Sources

  1. GitHub Advisory GHSA-vxm9-fcc8-7337 · GitHub Advisory Database

Cite this entry

"Malicious code in cryptostock (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 10, 2026; last updated August 10, 2026. https://supplychainattack.org/incident/malicious-code-in-cryptostock-npm-1yhkxb

Suggest a correction

Found an error or have a newer source? Corrections to factual errors take priority over new entries.

  1. resolvedcritical

    Malicious code in pump-segments-sdk (npm)

    The npm package pump-segments-sdk contained malicious code in a postinstall hook that exfiltrated sensitive system and npm configuration data to an attacker-controlled server. The package collected hostname, environment variables, system information, npm auth tokens, and attempted to read password hashes.

    npmCompromised package
  2. containedcritical

    Malicious code in ts-rand-sdk (npm)

    The npm package ts-rand-sdk contained malicious code disguised as a product catalog loader. When the advertised getTransactions() API was called, hidden obfuscated JavaScript was decoded and executed with full Node.js capabilities, enabling arbitrary filesystem, process, and network access on affected systems.

    npmCompromised package
  3. resolvedcritical

    Malicious code in lodsh-cli (npm)

    lodsh-cli, a typosquat of lodash-cli on npm, contained malicious code in its postinstall script that executed arbitrary remote code and exfiltrated system information. The package downloaded a Windows executable and sent platform data to a hardcoded IP address.

    npmTyposquattingCompromised package
  4. containedcritical

    Malicious code in lodahsjs (npm)

    The npm package lodahsjs is a typosquatting attack on 'lodash' that contains malicious code in its postinstall script. Upon installation, it exfiltrates system information to a C2 server and downloads and executes a Windows binary, with capability to bridge WSL environments to compromise the host Windows system.

    npmCompromised packageTyposquatting