MAL-2026-13345Malicious code in hd-key-generator (npm)
| Ecosystem | Package | Version |
|---|---|---|
| npm | hd-key-generator | 1.6.3 |
{"modified":"2026-08-05T15:40:03Z","published":"2026-08-05T15:40:03Z","schema_version":"1.7.4","id":"MAL-2026-13345","summary":"Malicious code in hd-key-generator (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (3a102f1d05a0bd89af765e457c2b5d6121ec831d33549d0cbf9795d58b0d3ee6)\nhd-key-generator is a typosquat of the `hdkey` package. On require(), index.js reads process.env, os.hostname(), os.userInfo().username, the user's home directory, platform, cwd, and package metadata, JSON-serializes and base64-encodes the payload, then issues an HTTPS GET to a hardcoded Telegram Bot API endpoint (api.telegram.org/bot<token>/sendMessage) with chat_id=8969499041. A tmp marker file is used to gate repeat sends. If the real `hdkey` package is present, it is re-exported to preserve apparent functionality; otherwise stub functions are returned. The full process.env dump captures any secrets the installer's shell or CI has exported (AWS_*, GITHUB_TOKEN, NPM_TOKEN, database credentials, and similar).\n","affected":[{"package":{"ecosystem":"npm","name":"hd-key-generator"},"versions":["1.6.3"],"database_specific":{"cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"indicators":{"evidence_files":[{"path":"index.js","sha256":"f8702540197ebac8dd4d30e085c94ecc54b6393cbe58c60efa80d93292d26dda","tlsh":"d12166c827f1f89d2272a551646f650fb3bbcaa20888eb20c598c4c37f701c899657d8"}],"package_integrity":[{"filename":"hd-key-generator-1.6.3.tgz","hashes":{"sha1":"ab4123fb01b74c53b951c27bb0789b2fe726ee6b","sha512_sri":"sha512-tm1biBvjAGTQSf5VsfkuSxmqIRwasr4kmxQUShZXk/g1e+0VT73NxCKjWigrrEwz1T1BDvZjbS22CfcfSixqjQ=="}}]}}}],"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/hd-key-generator/v/1.6.3"}],"credits":[{"name":"Amazon Inspector","type":"FINDER","contact":["inspector-research@amazon.com"]}],"database_specific":{"malicious-packages-origins":[{"id":"IN-MAL-2026-015786","import_time":"2026-08-05T16:13:45.022983532Z","modified_time":"2026-08-05T15:40:03Z","sha256":"3a102f1d05a0bd89af765e457c2b5d6121ec831d33549d0cbf9795d58b0d3ee6","source":"amazon-inspector","versions":["1.6.3"]}]}}数据来源:OpenSSF Malicious Packages · Apache-2.0