Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Malicious code in hardhat-test-log (npm)

0
Critical
Published: 06/24/2026 (06/24/2026, 04:13:05 UTC)
Source: GCVE Database
Product: hardhat-test-log

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.

Affected software

npmghsa
hardhat-test-log
Affected versions
=1.1.0=1.1.2

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/10/2026, 13:06:52 UTC

Technical Analysis

The hardhat-test-log package is a malicious npm package that impersonates well-known Hardhat gas reporter packages by copying their metadata and README content. Its main reporter function contains a dead-code gate that always executes a hidden function spawning a detached Node.js child process. This child process fetches JavaScript code from a public paste-style host and executes it dynamically with full Node.js require access, enabling remote code execution. The fetched payload is mutable and unchecked, allowing the attacker to change the code arbitrarily. This malicious behavior activates when the package is installed and used as a Hardhat/Mocha gas reporter, compromising developer or CI environments. Versions =1.1.0 and =1.1.2 are confirmed affected. There is no vendor advisory or patch available at this time.

Potential Impact

This vulnerability enables remote code execution on systems that install and run the hardhat-test-log package, including developer machines and continuous integration environments. The attacker gains the ability to execute arbitrary Node.js code with full module access, potentially leading to system compromise, data theft, or further malware deployment. The malicious payload is fetched dynamically from a public, mutable source, allowing ongoing attacker control after installation.

Mitigation Recommendations

No official patch or remediation is currently available. Users and organizations should immediately stop using the hardhat-test-log package, especially versions =1.1.0 and =1.1.2. Verify dependencies to ensure this package is not included transitively. Replace it with legitimate, verified packages such as eth-gas-reporter or hardhat-gas-reporter. Monitor build and CI environments for unexpected child processes or network connections to unknown hosts. Check vendor advisories for updates on remediation.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-6369
Osv Schema Version
1.7.4
Aliases
[]
Ecosystems
["npm"]
Database Specific Severity
null
Cvss Version
null

Threat ID: 6a42ed6927e9c7971993829a

Added to database: 06/29/2026, 22:10:49 UTC

Last enriched: 07/10/2026, 13:06:52 UTC

Last updated: 07/30/2026, 10:09:34 UTC

Views: 13

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses