Skip to main content

Malicious code in hardhat-lock (npm)

0
Critical
Published: 09/28/2026 (09/28/2026, 22:06:53 UTC)
Source: GCVE Database
Product: hardhat-lock

Description

The npm package [email protected] is a malicious package that impersonates a legitimate logging/middleware library but contains a large, heavily obfuscated payload that executes immediately upon import. This payload grants attacker-controlled code unrestricted access to environment variables, filesystem, and network within the Node.js process. The package misuses the Ethereum tooling keyword 'hardhat' and copies unrelated project documentation to disguise its true nature.

Affected software

npmghsa
hardhat-lock
Affected versions
=2.21.0

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: 09/29/2026, 04:47:19 UTC

Technical Analysis

The [email protected] npm package masquerades as a logger/middleware but is in fact a supply-chain attack vector. It copies README badges, LICENSE, and documentation from the unrelated pino project to appear legitimate. Its main code (lib/config.js) is a ~4MB obfuscated JavaScript file employing string array rotation, hex-escaped tokens, numeric wrapper decoders, control-flow flattening, and thousands of inline decoder replacements. This obfuscated code executes immediately when the package is required, injecting attacker-controlled code with full access to environment variables, filesystem, and network capabilities of the host Node.js process. This behavior indicates a malicious payload designed for supply-chain compromise.

Potential Impact

Installing and importing [email protected] results in execution of attacker-controlled code with unrestricted access to sensitive system resources such as environment variables, filesystem, and network. This can lead to data exfiltration, system compromise, and further malicious activities within the affected environment.

Mitigation Recommendations

No official patch or remediation is currently documented. Users should avoid installing or importing [email protected]. Conduct audits of dependencies to detect and remove this malicious package. Monitor package sources carefully and prefer verified, trusted packages. Patch status is not yet confirmed — check the vendor advisory or npm security advisories for updates.

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-17233
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6abb4187f7a7c54106cc2f89

Added to database: 09/29/2026, 04:41:43 UTC

Last enriched: 09/29/2026, 04:47:19 UTC

Last updated: 09/29/2026, 18:01:01 UTC

Views: 4

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