目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1359 元

100%
← 返回恶意软件包
npm active

hardhat-gas-analytics

MAL-2026-4576
2026-05-26 13:23:34
OpenSSF Malicious Packages
该软件包被识别为恶意包。建议隔离受影响环境,并排查凭据泄露和异常网络连接。

Summary

Malicious code in hardhat-gas-analytics (npm)

凭据/密钥窃取文件/数据外传
AI 分析整理qwen3.6
基于上游报告生成,请以下方原始证据为准。
公开使用量数据
统计周期
last-week
下载量
3
数据源
npmjs.org
下载量只代表仓库活动度,不等于已被入侵的安装数量。
受影响版本
EcosystemPackageVersion
npmhardhat-gas-analytics*
npmhardhat-gas-analytics3.0.0
npmhardhat-gas-analytics3.0.1
npmhardhat-gas-analytics3.1.0
npmhardhat-gas-analytics3.1.1
npmhardhat-gas-analytics3.1.2
恶意行为说明OpenSSF OSV
上游来源证据
展开原始 OSV JSON
{"modified":"2026-05-26T13:23:34Z","published":"2026-05-23T23:58:56Z","schema_version":"1.7.4","id":"MAL-2026-4576","aliases":["GHSA-7pxc-2jp3-w7c8"],"summary":"Malicious code in hardhat-gas-analytics (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (71b0b8dd866d9c1f4516f4e537a2d61ea3cbe87f06b0195a24c0dea76fef44c0)\nThis package typosquats the widely-used `hardhat-gas-reporter` Hardhat plugin (matching its cache filename `.hardhat_gas_reporter_output.json` and replicating its public API) while harvesting wallet credentials. On Hardhat environment extension (fires whenever the plugin is loaded via a project's hardhat config), `dist/index.js` iterates `Object.entries(process.env)`, retains every uppercase-keyed variable shorter than 1024 chars, and forwards the snapshot to `setProjectConfig` in `dist/utils/prices.js`. That code filters for keys matching `/KEY|PRIVATE|MNEMONIC|DEPLOYER|WALLET|SEED/i` — i.e., crypto wallet private keys, BIP-39 mnemonics, and deployer keys — AES-256-GCM encrypts them with a symmetric key derived as `sha256('ga:' + GAS_AGGREGATION_API)`, and base64url-encodes the (iv || tag || ciphertext) blob into the `X-Project-Id` HTTP header on a request to `https://gas-api.gasanalytics.dev/v1/prices?chain=...`. The encryption serves no functional purpose; its only effect is to conceal the exfiltrated payload from network inspection, proxies, and DLP. Any developer who installs this package by mistake (instead of `hardhat-gas-reporter`) and loads it in a Hardhat project that uses the conventional `PRIVATE_KEY` / `MNEMONIC` / `DEPLOYER_KEY` env-var pattern will have their on-chain signing keys silently exfiltrated, leading to direct fund loss.\n\n## Source: ghsa-malware (7e4488607d97045f9cd3bc6389f4bb3fa7326bfc6e91af8c3b561dc453c4d961)\nAny computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.\n","affected":[{"package":{"ecosystem":"npm","name":"hardhat-gas-analytics"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}],"versions":["3.1.0","3.1.2","3.1.1","3.0.0","3.0.1"],"database_specific":{"cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"},{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"},{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"},{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"},{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"},{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"indicators":{"domains":["pkg.pr.new"],"evidence_files":[{"path":"dist/utils/prices.js","sha256":"0fb16575097c0d5a461341a032dde2bb239a53bb6c120c6ab6a0f62d16f173f7","tlsh":"1412879328b2629303fb31dd12af8415a7f5e2272259d654775cc3c16f0207afad3ea6"},{"path":"README.md","sha256":"1c602624e896c097167adc439e081a02b636661d4c93924e60ed789591684a05","tlsh":"7ea2b6f35e0256750b33f3c6b29876b2ff29535c626229a9f0ae024e530f2b511be564"}],"package_integrity":[{"filename":"hardhat-gas-analytics-3.1.0.tgz","hashes":{"sha1":"c75d5c2b7e8b4c3f907007d48f04d039fd3c6e82","sha512_sri":"sha512-LLF5KgZwNeGGCNxUNPA6+d3Vu4PbjrZ75/CDia04UbT5GofOsSMCZIteVRJBTv+j2uAHCGUq4ub+riYDAMD4kA=="}}]}}}],"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/hardhat-gas-analytics/v/3.1.0"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/hardhat-gas-analytics/v/3.1.1"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/hardhat-gas-analytics/v/3.0.0"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/hardhat-gas-analytics/v/3.0.1"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/hardhat-gas-analytics/v/3.1.2"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-7pxc-2jp3-w7c8"}],"credits":[{"name":"Amazon Inspector","type":"FINDER","contact":["actran@amazon.com"]}],"database_specific":{"malicious-packages-origins":[{"source":"amazon-inspector","sha256":"156d8bd496eb6f33a2dfe50e65c4070df107bdfd5d95f337fa8655c53122287d","import_time":"2026-05-26T05:52:55.365927131Z","id":"IN-MAL-2026-004601","modified_time":"2026-05-25T08:30:00Z","versions":["3.1.0"]},{"source":"amazon-inspector","sha256":"d2bf2888dee01120e06e30f67fad0333095ecdbff9d6c7a99c39e3f8c7a16aca","import_time":"2026-05-26T05:52:55.930077849Z","id":"IN-MAL-2026-004606","modified_time":"2026-05-25T08:34:59Z","versions":["3.1.2"]},{"source":"amazon-inspector","sha256":"e0e1771f2d0d85fd40f21bdb5f2a72d7c5abc078043af3a1e394213b6c35b7d7","import_time":"2026-05-26T05:52:55.582325405Z","id":"IN-MAL-2026-004603","modified_time":"2026-05-25T08:32:05Z","versions":["3.1.1"]},{"source":"amazon-inspector","sha256":"5597c9cf8ef23943fe30a70c9e940b8a9b6b2b136298971b6e0ce771faf51afd","import_time":"2026-05-26T05:52:55.46954263Z","id":"IN-MAL-2026-004602","modified_time":"2026-05-25T08:30:00Z","versions":["3.1.0"]},{"source":"amazon-inspector","sha256":"71b0b8dd866d9c1f4516f4e537a2d61ea3cbe87f06b0195a24c0dea76fef44c0","import_time":"2026-05-26T05:52:32.310096583Z","id":"IN-MAL-2026-004407","modified_time":"2026-05-23T23:58:56Z","versions":["3.0.0"]},{"source":"amazon-inspector","sha256":"828c9d10dc000b21f19d537f5af02730041a6a93d247b10b661a0e218a061f6f","import_time":"2026-05-26T05:52:33.394276848Z","id":"IN-MAL-2026-004415","modified_time":"2026-05-24T00:42:20Z","versions":["3.0.1"]},{"source":"amazon-inspector","sha256":"9550680eb3f68102cb0608d6f83866b48e09144fbc0f5e420818cd6201ea3bc5","import_time":"2026-05-26T05:52:55.818348721Z","id":"IN-MAL-2026-004605","modified_time":"2026-05-25T08:34:59Z","versions":["3.1.2"]},{"source":"amazon-inspector","sha256":"9894127f1c3a2864da79f78efbac61a5f0404ecd402a5cb4d92397dcdafd5fbd","import_time":"2026-05-26T05:52:55.713116851Z","id":"IN-MAL-2026-004604","modified_time":"2026-05-25T08:32:05Z","versions":["3.1.1"]},{"source":"ghsa-malware","sha256":"7e4488607d97045f9cd3bc6389f4bb3fa7326bfc6e91af8c3b561dc453c4d961","import_time":"2026-05-26T13:21:46.723947155Z","id":"GHSA-7pxc-2jp3-w7c8","modified_time":"2026-05-26T11:56:00Z","ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}]}]}}

数据来源:OpenSSF Malicious Packages · Apache-2.0