Malicious Code Vulnerability in hardhat-devkit Package

hardhat-devkit Updated 21 Sep 2026

Summary

21/09/2026
CRITICAL
No i
Critical
Not published

MAL-2026-16349: Malicious code in hardhat-devkit (npm). Affects hardhat-devkit versions 2.3.6. 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-devkit package is designed as a toolkit for Ethereum and Hardhat developers, providing essential tools and utilities for blockchain development. However, this package has been compromised, presenting a facade of legitimacy while harboring malicious code that targets developers' sensitive information.

Vulnerability Detail

The vulnerability stems from the hardhat-devkit package, which executes a heavily obfuscated JavaScript file upon loading. This file, located in lib/config.js, is designed to conceal its true purpose, which is to execute malicious actions on the user's machine. The obfuscation techniques employed include hex-escaped identifiers, self-mutating string arrays, and control-flow flattening, making it difficult for developers to identify the malicious intent. The potential ramifications include unauthorized access to sensitive wallet information, deployment keys, and other critical data, posing a significant risk to developers in the Ethereum ecosystem.

How To Fix

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

npm uninstall hardhat-devkit

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-devkit package and consider alternative packages that provide similar functionality without the associated risks. Regularly audit your dependencies to ensure no malicious packages are included in your project.

Conclusion

The hardhat-devkit package has been identified as containing malicious code that poses a significant risk to Ethereum developers. It is essential to remove this package and stay vigilant about the security of your dependencies. Utilizing tools like Vulert can aid in monitoring for vulnerabilities in real-time.

See every vulnerability recorded for hardhat-devkit →

Share this vulnerability

FAQ

The hardhat-devkit package is a toolkit intended for Ethereum and Hardhat developers, offering various utilities for blockchain development.

The malicious code executes upon loading the package, running an obfuscated script that can compromise sensitive information on the developer's machine.

If you have installed the hardhat-devkit package, it is recommended to remove it immediately and monitor your system for any unauthorized access.

Regularly audit your dependencies, use tools like Vulert to monitor for vulnerabilities, and only install packages from trusted sources.

Vulert is a tool that monitors and alerts for open-source vulnerabilities in your software using just package-lock.json. You can check if your application is affected by this vulnerability using the Vulert playground without any signup.

How To Fix

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

npm uninstall hardhat-devkit

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