Malicious Code Injection in hardhat-option Package

hardhat-option Updated 08 Oct 2026

Summary

08/10/2026
CRITICAL
No i
Critical
Not published

MAL-2026-17660: Malicious code in hardhat-option (npm). Affects hardhat-option versions 2.0.1. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The hardhat-option package is a Node.js library designed to provide configuration options for Hardhat, a popular Ethereum development environment. This package is intended to simplify the development process for blockchain applications. However, it has been compromised, embedding malicious code that executes upon import, posing significant security risks to users.

Vulnerability Detail

The vulnerability in the hardhat-option package arises from its main index.js file, which immediately requires a heavily obfuscated lib/config module. This module is a large bundle that executes a malicious payload with the installer's privileges as soon as it is loaded. The package misrepresents itself by copying content from the pino package, creating confusion about its true identity. The obfuscation and auto-execution characteristics make it a classic loader/dropper, potentially leading to unauthorized access or data breaches.

How To Fix

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

npm uninstall hardhat-option

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, consider removing the hardhat-option package from your project until a secure version is released. You can do this by running: npm uninstall hardhat-option.

Conclusion

The hardhat-option package has been compromised with malicious code that executes upon import, posing significant security risks. Users are advised to update the package to a patched version or remove it entirely until a fix is available. Utilizing tools like Vulert can help monitor for such vulnerabilities in real-time.

See every vulnerability recorded for hardhat-option →

Share this vulnerability

FAQ

The hardhat-option package is a Node.js library that provides configuration options for the Hardhat Ethereum development environment.

The vulnerability allows malicious code to execute with the privileges of the user who installed the package, potentially leading to security breaches.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected by this vulnerability.

Users should check the npm registry for any patched versions of the hardhat-option package and update accordingly.

As a temporary measure, uninstall the hardhat-option package from your project to mitigate the risk until a secure version is available.

How To Fix

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

npm uninstall hardhat-option

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