Skip to content
supplychainattack.orgSupply chain attack incident catalog
resolvedcritical

Malicious code in hdkey-wallet (npm)

The npm package hdkey-wallet contained malicious code that exfiltrated environment variables (including AWS_*, NPM_TOKEN, GITHUB_TOKEN) and system information to an attacker-controlled Telegram bot on module load. The package was designed as a typosquat/lookalike of the legitimate hdkey library.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
Any developer or CI/CD environment that installed hdkey-wallet from npm, particularly those with AWS, NPM, or GitHub credentials in environment variables.
Ecosystems
Attack vectors
Affected entities
  • hdkey-walletMalicious npm package impersonating legitimate hdkey library

The npm package hdkey-wallet was published with embedded malicious code that executed on module load. Upon require(), the package read the complete process.env object along with hostname, username, home directory, platform, and current working directory, then JSON-encoded and base64-wrapped the payload before transmitting it via HTTPS to api.telegram.org using a hardcoded Telegram Bot API token and chat ID (8969499041).\n\nThe package was designed to impersonate the legitimate hdkey library, with a deceptive package name and README presenting it as a drop-in replacement. The malicious module attempted to require() the real hdkey library and re-export it, using the legitimate library as functional cover for the credential theft attack.\n\nEnvironments commonly holding sensitive credentials—such as AWS_*, NPM_TOKEN, and GITHUB_TOKEN—were directly exposed to the attacker-controlled Telegram bot. A tmpdir flag file was used to guard against repeated exfiltration attempts.\n\nThe incident was identified and credited to the OpenSSF's malicious-packages repository (MAL-2026-13346).

Indicators of compromise

Packages
  • hdkey-wallet
Domains
  • api.telegram.org

Remediation

  • Immediately uninstall hdkey-wallet from all environments
  • Rotate all credentials that may have been exposed (AWS keys, NPM tokens, GitHub tokens, etc.)
  • Audit npm package.json and lock files for any installations of hdkey-wallet
  • Review CI/CD logs for any hdkey-wallet installations or require() calls
  • Use the legitimate hdkey package instead if hdkey functionality is needed
  • Implement package name verification and allowlisting in dependency management
  • Monitor Telegram bot activity and report the bot token to Telegram for takedown

Sources

  1. GitHub Advisory GHSA-rhq6-6gvr-pwqm · GitHub Advisory Database

Cite this entry

"Malicious code in hdkey-wallet (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 5, 2026; last updated August 5, 2026. https://supplychainattack.org/incident/malicious-code-in-hdkey-wallet-npm-4t6u1k

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 akamai-sensor (npm)

    A malicious npm package named akamai-sensor impersonated Akamai's legitimate sensor_data anti-bot SDK. The package contained hidden JavaScript code concealed using invisible Unicode characters and implemented a dynamic command-and-control channel via a Google Calendar dead-drop, enabling arbitrary code execution on installation.

    npmCompromised packageTyposquatting
  2. resolvedcritical

    Malicious code in @finaxis/common-js (npm)

    The npm package @finaxis/common-js was published with a README and keywords copied from lodash v4.18.1, but contained a heavily obfuscated Xelis (XEL) proof-of-work cryptominer instead of lodash functionality. Consumers installing this package would unknowingly run a covert CPU/GPU miner on their systems.

    npmCompromised packageTyposquatting
  3. resolvedcritical

    Malicious code in depcruise-wrap-stream-in-html (npm)

    depcruise-wrap-stream-in-html@99.9.1 is a malicious npm package that mimics an internal helper of dependency-cruiser. It is a hollow package that downloads and executes arbitrary code from a Google Cloud Storage bucket during installation.

    npmCompromised packageDependency confusionTyposquatting
  4. containedcritical

    Malicious code in axios-fast (npm)

    axios-fast@1.0.1 on npm contains malicious code that exfiltrates environment variables (including AWS credentials, NPM tokens, and GitHub tokens) to an attacker-controlled webhook during package installation. The package typosquats the legitimate axios HTTP client library.

    npmCompromised packageTyposquatting