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-set (npm)

0
High
Published: 08/07/2026 (08/07/2026, 12:57:29 UTC)
Source: GCVE Database
Product: hardhat-set

Description

The npm package 'hardhat-set' version 2.21.0 is a malicious typosquatting package masquerading as a legitimate project. It contains a large, heavily obfuscated JavaScript payload that executes immediately upon import. The package's README and documentation are copied from an unrelated project (pino logger), and the author information points to an unrelated domain, indicating deception. This package delivers a hidden payload to users who install or require it.

Affected software

npmghsa
hardhat-set
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: 08/07/2026, 15:20:20 UTC

Technical Analysis

The 'hardhat-set' npm package (version 2.21.0) is a malicious typosquatting package that impersonates the Hardhat project but includes copied documentation from the unrelated pino logger project. Its main JavaScript file loads a 4MB obfuscated script using techniques such as string array rotation, RC4/base64 decoding, control-flow flattening, and self-defending checks. This obfuscated code runs immediately on require, delivering a hidden payload. The package author and bug report URLs are unrelated to the legitimate Hardhat project, further indicating malicious intent. No legitimate exports from the obfuscated module are used, confirming the payload is hidden and not part of normal functionality.

Potential Impact

Users who install or require 'hardhat-set' version 2.21.0 risk executing a large obfuscated malicious payload that could compromise their environment. The exact impact is not detailed, but the presence of self-executing obfuscated code in a typosquatting package suggests potential for unauthorized code execution, data compromise, or further malware delivery.

Mitigation Recommendations

There is no information about an available patch or official fix for this package. The best mitigation is to avoid installing or requiring the 'hardhat-set' package, especially version 2.21.0. Users should verify package authenticity before installation and prefer official sources. Monitor package repositories for removal or vendor advisories regarding this malicious package. Patch status is not yet confirmed — check the vendor advisory or npm security advisories for current remediation guidance.

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-13609
Osv Schema Version
1.7.4
Aliases
[]
Ecosystems
["npm"]
Database Specific Severity
null
Cvss Version
null

Threat ID: 6a75f709bf8831d53984ec5d

Added to database: 08/07/2026, 15:17:29 UTC

Last enriched: 08/07/2026, 15:20:20 UTC

Last updated: 08/07/2026, 15:20:20 UTC

Views: 2

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