Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
Malicious package

hardhat-gas-analyticsnpm

Malicious code in hardhat-gas-analytics (npm) Remove it immediately and rotate any exposed credentials.

MAL-2026-4576
Immediate action
Remove the package, then rotate any secrets the build/runtime could reach.
npm uninstall hardhat-gas-analytics

What this malware does

This 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.

Any 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.

Malicious versions

5 flagged
3.0.03.0.13.1.03.1.13.1.2

Indicators of compromise (SHA-256)

156d8bd496eb6f33a2dfe50e65c4070df107bdfd5d95f337fa8655c53122287d
d2bf2888dee01120e06e30f67fad0333095ecdbff9d6c7a99c39e3f8c7a16aca
e0e1771f2d0d85fd40f21bdb5f2a72d7c5abc078043af3a1e394213b6c35b7d7
5597c9cf8ef23943fe30a70c9e940b8a9b6b2b136298971b6e0ce771faf51afd
71b0b8dd866d9c1f4516f4e537a2d61ea3cbe87f06b0195a24c0dea76fef44c0
828c9d10dc000b21f19d537f5af02730041a6a93d247b10b661a0e218a061f6f
9550680eb3f68102cb0608d6f83866b48e09144fbc0f5e420818cd6201ea3bc5
9894127f1c3a2864da79f78efbac61a5f0404ecd402a5cb4d92397dcdafd5fbd
7e4488607d97045f9cd3bc6389f4bb3fa7326bfc6e91af8c3b561dc453c4d961

Detection & response playbook

Credential / info stealer
  1. Find it

    Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for hardhat-gas-analytics (5 malicious versions). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging hardhat-gas-analytics across your stack and pipelines.

  2. If you installed it — respond

    hardhat-gas-analytics is built to steal secrets, so assume every credential the build or runtime could read is compromised. Remove it from your project and lockfile, then rotate ALL exposed secrets — npm/registry tokens, cloud keys, CI/CD secrets, SSH keys, and any .env values — from a known-clean machine. Audit logs for unauthorized use of those credentials.

  3. Did it already run?

    If hardhat-gas-analytics was ever installed, its post-install/runtime payload may have already executed. O3's L7 egress monitoring and runtime eBPF sensors detect the credential exfiltration or command-and-control callback after install and block the malicious outbound channel, so you catch and contain the actual compromise — not just the presence of the package.

  4. How O3 protects you

    O3 blocks hardhat-gas-analytics before install through its supply-chain scanner, and if it has already run, detects and severs the exfiltration or C2 callback at runtime through L7 egress monitoring and eBPF.

Frequently asked questions

No. hardhat-gas-analytics on npm has been identified as a malicious package (versions 3.0.0, 3.0.1, 3.1.0, 3.1.1, 3.1.2 flagged). It should be removed immediately — do not install or keep it in your dependency tree.

Campaign

IN-MAL-2026-004601IN-MAL-2026-004606IN-MAL-2026-004603IN-MAL-2026-004602IN-MAL-2026-004407IN-MAL-2026-004415IN-MAL-2026-004605IN-MAL-2026-004604GHSA-7pxc-2jp3-w7c8

References

Credits

  • Amazon Inspector · finder

Detect & block this

O3 blocks hardhat-gas-analytics-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the credential exfiltration and severs the channel.

hardhat-gas-analytics (npm) malicious package — MAL-2026-4576 | O3 Security