Skip to main content
MalwarePublished

hd-key-generator (npm) · Malicious Code

Affects hd-key-generatorSource GCVE Database

0

Malicious package : remove hd-key-generator and rotate any secrets on hosts that installed it.

Data as of 5 Aug 2026, 23:01 UTC

Classification

Malicious package

Published to npm · OSV MAL-2026-13345

What to do

Remove hd-key-generator from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.

Affected software

ProductAffectedFixed in
npmhd-key-generatorAffected
  • =1.6.3
Fixed in–

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

Description

The hd-key-generator npm package is a malicious typosquat of the legitimate hdkey package. Upon being required, it collects extensive environment information including environment variables, hostname, username, home directory, platform, current working directory, and package metadata. This data is serialized, encoded, and sent via an HTTPS GET request to a hardcoded Telegram Bot API endpoint, potentially exposing sensitive secrets such as AWS credentials, GitHub tokens, and database credentials. The package attempts to maintain the appearance of normal functionality by re-exporting the real hdkey package if it is installed, or providing stub functions otherwise. Only version 1.6.3 of hd-key-generator is known to be affected. There is no CVSS score or known exploits in the wild reported for this threat.

References

Community reviews

Loading reviews…