Malicious Code Injection in hardhat-ftp Package

hardhat-ftp Updated 05 Oct 2026

Summary

04/10/2026
CRITICAL
No i
Critical
Not published

MAL-2026-17506: Malicious code in hardhat-ftp (npm). Affects hardhat-ftp 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The hardhat-ftp package is an npm module designed to facilitate FTP operations within the Hardhat development environment. It is intended to provide developers with a streamlined way to manage file transfers during the development process. However, this package has been compromised, embedding malicious code that poses significant security risks to users.

Vulnerability Detail

The vulnerability originates from the hardhat-ftp package's main entry point, index.js, which unconditionally requires a large obfuscated file located at /lib/config. This file, packed using obfuscator.io, executes malicious code as soon as the package is required. The obfuscation conceals the true nature of the code, which includes outbound HTTP requests and local command execution capabilities. This means that any user who installs or requires this package inadvertently executes attacker-controlled code, leading to potential data breaches or system compromises.

How To Fix

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

npm uninstall hardhat-ftp

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-ftp package altogether until a secure version is released. If you must use it, consider isolating the environment in which it runs to minimize potential damage.

Conclusion

The hardhat-ftp package has been compromised with malicious code that executes upon installation. Users are advised to uninstall the package and seek alternatives to mitigate the risks associated with this vulnerability. Regular monitoring for vulnerabilities is essential to maintain the security of your projects.

See every vulnerability recorded for hardhat-ftp →

Share this vulnerability

FAQ

The hardhat-ftp package is an npm module designed to facilitate FTP operations within the Hardhat development environment.

The malicious code executes automatically when the package is required in a project, due to the unconditioned require statement in index.js.

The risks include unauthorized access to sensitive data, potential system compromise, and the execution of arbitrary commands on the user's machine.

You can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities using just the package-lock.json file. Visit https://vulert.com for more information.

Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

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

npm uninstall hardhat-ftp

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