Malicious code in hdkey-wallet (npm)
The hdkey-wallet npm package version 2.1.0 contains malicious code that exfiltrates environment variables and system information to an attacker-controlled Telegram bot. It masquerades as a drop-in replacement for the legitimate hdkey library, forwarding legitimate functionality while stealing sensitive credentials such as AWS, NPM, and GitHub tokens from process.env. The exfiltration occurs once per environment due to a temporary flag file. No official patch or remediation guidance is currently provided.
AI Analysis
Technical Summary
The hdkey-wallet npm package (version 2.1.0) includes malicious code that, upon module load, collects the entire process.env object along with hostname, username, home directory, platform, and current working directory. This data is JSON-encoded, base64-wrapped, and sent via HTTPS GET request to the Telegram Bot API using a hardcoded bot token and chat_id. The package attempts to require and re-export the legitimate hdkey library to maintain expected functionality and avoid suspicion. A temporary flag file prevents repeated data exfiltration. This behavior exposes sensitive environment variables commonly containing credentials such as AWS_*, NPM_TOKEN, and GITHUB_TOKEN to the attacker.
Potential Impact
Sensitive environment variables and system information are exfiltrated to an attacker-controlled Telegram bot, potentially compromising credentials and secrets stored in the environment. This can lead to unauthorized access to cloud services, package repositories, and source code repositories. The malicious package masquerades as a legitimate dependency, increasing the risk of widespread compromise if used in development or production environments.
Mitigation Recommendations
No official patch or remediation guidance is currently available. Users should immediately remove the hdkey-wallet package version 2.1.0 from their projects and replace it with the legitimate hdkey library. Review and rotate any credentials or tokens that may have been exposed through environment variables. Monitor for any unauthorized access resulting from credential compromise. Exercise caution when installing packages and verify the authenticity of dependencies.
Malicious code in hdkey-wallet (npm)
Description
The hdkey-wallet npm package version 2.1.0 contains malicious code that exfiltrates environment variables and system information to an attacker-controlled Telegram bot. It masquerades as a drop-in replacement for the legitimate hdkey library, forwarding legitimate functionality while stealing sensitive credentials such as AWS, NPM, and GitHub tokens from process.env. The exfiltration occurs once per environment due to a temporary flag file. No official patch or remediation guidance is currently provided.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The hdkey-wallet npm package (version 2.1.0) includes malicious code that, upon module load, collects the entire process.env object along with hostname, username, home directory, platform, and current working directory. This data is JSON-encoded, base64-wrapped, and sent via HTTPS GET request to the Telegram Bot API using a hardcoded bot token and chat_id. The package attempts to require and re-export the legitimate hdkey library to maintain expected functionality and avoid suspicion. A temporary flag file prevents repeated data exfiltration. This behavior exposes sensitive environment variables commonly containing credentials such as AWS_*, NPM_TOKEN, and GITHUB_TOKEN to the attacker.
Potential Impact
Sensitive environment variables and system information are exfiltrated to an attacker-controlled Telegram bot, potentially compromising credentials and secrets stored in the environment. This can lead to unauthorized access to cloud services, package repositories, and source code repositories. The malicious package masquerades as a legitimate dependency, increasing the risk of widespread compromise if used in development or production environments.
Mitigation Recommendations
No official patch or remediation guidance is currently available. Users should immediately remove the hdkey-wallet package version 2.1.0 from their projects and replace it with the legitimate hdkey library. Review and rotate any credentials or tokens that may have been exposed through environment variables. Monitor for any unauthorized access resulting from credential compromise. Exercise caution when installing packages and verify the authenticity of dependencies.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-13346
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6a738520bf8831d5394ef8e2
Added to database: 08/05/2026, 18:46:56 UTC
Last enriched: 08/05/2026, 23:01:12 UTC
Last updated: 09/07/2026, 22:11:05 UTC
Views: 16
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.