{"id":"MAL-2026-17506","summary":"Malicious code in hardhat-ftp (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (5e916c23a0efbd49d3cfcd5993957df7afbade3f454925d0672acc8c9f68245c)\nThe package's declared main entry index.js unconditionally requires./lib/config, a 4,499,968-byte obfuscator.io-packed file (26,234-entry string array, hex-renamed identifiers, control-flow flattening, top-level IIFE) that executes as soon as any consumer runs `require('hardhat-ftp')`. After string-array decoding the loader resolves to execSync and spawn sinks, and the package declares axios as a dependency, giving the import-time payload both outbound HTTP and local command-execution primitives with the concrete command targets concealed behind the obfuscation. The surrounding package is a cover: it is published under the name hardhat-ftp with a vulnerability-management description, but the README headers, badges, and ecosystem links are lifted from pinojs/pino, and the files under lib/ (proto.js, levels.js, transport.js, multistream.js) mirror the pino source tree. The name/README/code mismatch, the scale of the obfuscation, and the presence of exec+HTTP primitives inside the auto-loaded module match the masquerade-dropper pattern: installing or requiring this package triggers execution of concealed attacker-controlled code on the installer's host.\n","modified":"2026-10-04T23:45:20.824862061Z","published":"2026-10-04T23:28:14Z","database_specific":{"malicious-packages-origins":[{"modified_time":"2026-10-04T23:28:14Z","sha256":"5e916c23a0efbd49d3cfcd5993957df7afbade3f454925d0672acc8c9f68245c","source":"amazon-inspector","versions":["2.0.1"],"id":"IN-MAL-2026-020972","import_time":"2026-10-04T23:40:47.242949633Z"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/hardhat-ftp/v/2.0.1"}],"affected":[{"package":{"name":"hardhat-ftp","ecosystem":"npm","purl":"pkg:npm/hardhat-ftp"},"versions":["2.0.1"],"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":"4e6c4e61a7019ab0affe9c2d20e36701b330ec357be205930355bac1464f9316","tlsh":"0421149124d560ce9938dac0f6306115acdbc677260752b3bdfc97c927860080161fba"},{"path":"lib/config.js","sha256":"b01c59ae0a76527503799aab109bd701e34f260d192722a8cf12c97a4e6d208c","tlsh":"61265f889244e03796cf1ac3bf0529ede57aa861e4cca30797d4be5cb9ac40bd4b5dd0"},{"tlsh":"f341956787e47fbd5f6301b2d1c275a9ff2f931c3b6a60b5d99c81291318592813220a","path":"README.md","sha256":"c0c8df575a9649d7018059a65ef8b9401b239931fac87a3957c9ca7067e5d110"}],"package_integrity":[{"filename":"hardhat-ftp-2.0.1.tgz","hashes":{"sha512_sri":"sha512-ETjN3tQw1gUCCIyiNlecrOM7ZQ4M3ivCpNVBWFLAbCQ8R/LH+o7674juZ+Vcz4PQCcZYSXww+OWoPmsJlRnL3w==","sha1":"71b0d1a5e2bc520caedbcfe0a7cd7e4fc769f00b"}}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/hardhat-ftp/MAL-2026-17506.json"}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}