Skip to main content
MalwarePublished Updated

hardhat-test-log (npm) · Malicious Code

Affects hardhat-test-logSource GCVE Database

0

Malicious package : remove hardhat-test-log and rotate any secrets on hosts that installed it.

Data as of 10 Jul 2026, 13:06 UTC

Classification

Malicious package

Published to npm · OSV MAL-2026-6369

What to do

Remove hardhat-test-log from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.

Affected software

ProductAffectedFixed in
npmhardhat-test-logAffected
  • =1.1.0
  • =1.1.2
Fixed in–

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

Description

The hardhat-test-log npm package impersonates legitimate Hardhat gas reporter packages to deliver malicious code. It contains dead code that always triggers a hidden function spawning a detached child process, which fetches and executes attacker-controlled code from a public paste service. This results in remote code execution on developer or CI machines using the package. Versions 1.1.0 and 1.1.2 are affected. No official patch or remediation is currently documented.

References

Community reviews

Loading reviews…