Malicious Code Detected in hardhat-plus Package - Version 2.21.0

hardhat-plus Updated 05 Oct 2026

Summary

04/10/2026
CRITICAL
No i
Critical
Not published

MAL-2026-17508: Malicious code in hardhat-plus (npm). Affects hardhat-plus versions 2.21.0. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The hardhat-plus package is designed to extend the functionality of the Hardhat Ethereum development environment. It aims to provide additional tools and utilities for developers working on Ethereum-based applications. However, the package has been found to contain malicious code that poses significant security risks to users.

Vulnerability Detail

The vulnerability originates from the hardhat-plus package version 2.21.0, which has been identified as containing malicious code. The package masquerades as a legitimate Hardhat plugin but includes a large, heavily obfuscated JavaScript file that executes upon import. This obfuscation is characteristic of supply-chain malware, which can lead to unauthorized access, data theft, or further exploitation of the user's environment. The obfuscated code is designed to run unconditionally, making it a severe threat to any application that imports this package.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall hardhat-plus

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, avoid using the hardhat-plus package altogether and look for alternative packages that provide similar functionality without the associated risks. Ensure to audit your package dependencies regularly.

Conclusion

The hardhat-plus package version 2.21.0 has been identified as containing malicious code that poses significant risks to users. It is essential to remove this package from your projects and seek alternatives to ensure the security of your applications. Regular audits and monitoring of dependencies are crucial in maintaining a secure development environment.

See every vulnerability recorded for hardhat-plus →

Share this vulnerability

FAQ

The hardhat-plus package is an npm package intended to enhance the Hardhat Ethereum development environment with additional tools and utilities.

The malicious code can execute upon import, potentially leading to unauthorized access, data theft, or exploitation of your application.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Check your application against the vulnerability using the Vulert playground at Vulert Scanner.

If you have installed hardhat-plus, it is crucial to uninstall it immediately and look for alternative packages that do not pose security risks.

Yes, consider using other well-reviewed packages that provide similar functionalities without the associated risks. Always verify the integrity of packages before installation.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall hardhat-plus

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback