Malicious Code Vulnerability in @selfpentest/eslint-pentest-plugin: A Supply Chain Attack
Summary
MAL-2026-17293: Malicious code in @selfpentest/eslint-pentest-plugin (npm). Affects @selfpentest/eslint-pentest-plugin versions 1.0.0. No fix is published. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
The @selfpentest/eslint-pentest-plugin is an npm package designed to function as an ESLint plugin, which is typically used to analyze JavaScript code for potential errors and enforce coding standards. However, this package has been identified as a malicious entity that masquerades as a legitimate plugin while executing harmful operations. Its primary functionality is compromised, as it does not provide any actual linting capabilities but instead serves as a vector for a supply chain attack.
Vulnerability Detail
The vulnerability originates from the package's design, where the exported plugin object is an empty shell. The index.js file contains a top-level invocation of a steal() routine that executes unconditionally upon requiring the package. This means that any attempt to use the package, including automatic loading by ESLint, triggers the malicious payload. The payload captures sensitive environment variables such as process.env.HOME and process.env.SECRET, reads the first 30 bytes of the user's known_hosts file, and sends this information to a local HTTP server at localhost:1337. Although the data does not leave the host unless a local listener is present, the code executes on every require of the package, posing a significant security risk.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @selfpentest/eslint-pentest-plugin
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 @selfpentest/eslint-pentest-plugin in your project. If you need similar functionality, consider using an alternative ESLint plugin that has been verified as safe and legitimate.
Conclusion
The @selfpentest/eslint-pentest-plugin presents a serious security risk due to its embedded malicious code that executes on every require. Users are advised to uninstall the package immediately and monitor for any updates or patches. Utilizing tools like Vulert can help in identifying such vulnerabilities in your projects.
See every vulnerability recorded for @selfpentest/eslint-pentest-plugin →
FAQ
The vulnerability involves malicious code that executes upon requiring the package, capturing sensitive information and sending it to a local server.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without requiring signup.
You should uninstall the package immediately using the command npm uninstall @selfpentest/eslint-pentest-plugin.
Currently, there is no patched version available. It is recommended to remove the package until a safe version is released.
Failure to address this vulnerability could lead to unauthorized access to sensitive information stored in environment variables and known_hosts files, potentially compromising your system's security.