Malicious code in hardhat-set (npm)
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.
AI Analysis
Technical Summary
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.
Malicious code in hardhat-set (npm)
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
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
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.
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 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.