{"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\u003ctoken\u003e/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","modified":"2026-08-05T16:51:04.279377057Z","published":"2026-08-05T15:40:03Z","database_specific":{"malicious-packages-origins":[{"source":"amazon-inspector","versions":["1.6.3"],"id":"IN-MAL-2026-015786","import_time":"2026-08-05T16:13:45.022983532Z","modified_time":"2026-08-05T15:40:03Z","sha256":"3a102f1d05a0bd89af765e457c2b5d6121ec831d33549d0cbf9795d58b0d3ee6"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/hd-key-generator/v/1.6.3"}],"affected":[{"package":{"name":"hd-key-generator","ecosystem":"npm","purl":"pkg:npm/hd-key-generator"},"versions":["1.6.3"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/hd-key-generator/MAL-2026-13345.json","cwes":[{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."}],"indicators":{"package_integrity":[{"filename":"hd-key-generator-1.6.3.tgz","hashes":{"sha1":"ab4123fb01b74c53b951c27bb0789b2fe726ee6b","sha512_sri":"sha512-tm1biBvjAGTQSf5VsfkuSxmqIRwasr4kmxQUShZXk/g1e+0VT73NxCKjWigrrEwz1T1BDvZjbS22CfcfSixqjQ=="}}],"evidence_files":[{"sha256":"f8702540197ebac8dd4d30e085c94ecc54b6393cbe58c60efa80d93292d26dda","tlsh":"d12166c827f1f89d2272a551646f650fb3bbcaa20888eb20c598c4c37f701c899657d8","path":"index.js"}]}}}],"schema_version":"1.8.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}