{"id":"MAL-2026-17661","summary":"Malicious code in hardhat-pack (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (b39859996d5d333a776d3ed42a203450ea588adefd91ba46a25a0bef0b17cf02)\nThe package is published as `hardhat-pack`, a name shape that resembles the Hardhat Ethereum tooling ecosystem, but its README, LICENSE, TypeScript declarations and library source are copied verbatim from the unrelated `pino` logger. The only material divergence from upstream pino is that `index.js` adds `const config = require('./lib/config');` at the top level, and `lib/config.js` is a single-line 4.4MB obfuscator.io payload: an IIFE with a ~26,000-entry hex-escaped string array and a rotating decoder. Nothing in the shipped source references `config` for a legitimate purpose, and the package carries no native build, no vendored SDK, and no other justification for a multi-megabyte opaque blob. The package also declares `axios` as a runtime dependency, consistent with network exfiltration or remote fetch from inside the decoded payload. Any process that imports `hardhat-pack` hands the opaque payload to the JavaScript engine on first require.\n","modified":"2026-10-08T04:00:04.223122265Z","published":"2026-10-08T03:43:57Z","database_specific":{"malicious-packages-origins":[{"sha256":"b39859996d5d333a776d3ed42a203450ea588adefd91ba46a25a0bef0b17cf02","source":"amazon-inspector","versions":["2.0.1"],"id":"IN-MAL-2026-021133","import_time":"2026-10-08T03:50:30.086107934Z","modified_time":"2026-10-08T03:43:57Z"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/hardhat-pack/v/2.0.1"}],"affected":[{"package":{"name":"hardhat-pack","ecosystem":"npm","purl":"pkg:npm/hardhat-pack"},"versions":["2.0.1"],"database_specific":{"cwes":[{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"}],"indicators":{"evidence_files":[{"tlsh":"61265f889244e03796cf1ac3bf0529ede57aa861e4cca30797d4be5cb9ac40bd4b5dd0","path":"lib/config.js","sha256":"b01c59ae0a76527503799aab109bd701e34f260d192722a8cf12c97a4e6d208c"},{"path":"package.json","sha256":"947d477618759a0bcd5a4426c5e91751f1bd3d5c5363326cde99b35009a88248","tlsh":"c5017620deb88e2305ed25424c2a0603b6a58c175528fc2933dba12c4fad5ff41bf22d"}],"package_integrity":[{"filename":"hardhat-pack-2.0.1.tgz","hashes":{"sha1":"9d0bbc030f64f09a98e4c425f5f248689e8eb217","sha512_sri":"sha512-jnJmr5Rg99If4NpjXqZ0+ZBO34HdD+8lpneBnmNLZUZgvoN4POqjOgkVuW5acnUofdyeDQIJrarNMYuIEpMyHA=="}}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/hardhat-pack/MAL-2026-17661.json"}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}