hdkey-walletnpm
Advisory published Updated
hdkey-wallet is a confirmed malicious npm package (MAL-2026-13346) that steals credentials and exfiltrates sensitive data (malicious version 2.1.0). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in hdkey-wallet (npm)
What this malware does
On module load, index.js reads the complete process.env object along with hostname, username, home directory, platform, and current working directory, JSON-encodes and base64-wraps the payload, and transmits it via https.get to api.telegram.org's Bot API using a hardcoded bot token and chat_id 8969499041. A tmpdir flag file guards against repeated exfiltration. The package name and README present it as a drop-in replacement for the legitimate hdkey library, and the module attempts to require('hdkey') and re-export it when present, using the real library as a functional cover for the credential theft that fires on require(). Environments commonly holding secrets such as AWS_*, NPM_TOKEN, and GITHUB_TOKEN in process.env are directly exposed to the attacker-controlled Telegram bot.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Credential / info stealerFind it
Search your lockfiles and build artifacts for hdkey-wallet (version 2.1.0).
If you installed it — respond
hdkey-wallet is built to steal secrets, so assume every credential the build or runtime could read is compromised. Remove it from your project and lockfile, then rotate ALL exposed secrets — npm/registry tokens, cloud keys, CI/CD secrets, SSH keys, and any .env values — from a known-clean machine. Audit logs for unauthorized use of those credentials.
Did it already run?
If hdkey-wallet was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Detect & block this
O3 blocks hdkey-wallet-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the credential exfiltration and severs the channel.