Malicious Code Vulnerability in @selfpentest/bin-confusion: A Threat to npm Users

@selfpentest/bin-confusion Updated 30 Sep 2026

Summary

29/09/2026
CRITICAL
No i
Critical
Not published

MAL-2026-17292: Malicious code in @selfpentest/bin-confusion (npm). Affects @selfpentest/bin-confusion versions 1.0.0 – 1.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 package @selfpentest/bin-confusion is an npm package that is designed to demonstrate security vulnerabilities in dependency management. It contains a malicious script that collides with the core npm CLI, potentially compromising the security of projects that include it as a dependency. This package is particularly concerning due to its ability to exfiltrate sensitive information from the environment and SSH configurations.

Vulnerability Detail

The vulnerability arises from the package registering a 'bin' entry named 'npm' that points to a malicious script (npm.js). When this package is installed, any invocation of 'npm...' in the consuming project's scripts resolves to this malicious shim, executing harmful code instead of the legitimate npm CLI. The malicious script collects sensitive data, including environment variables and SSH known_hosts, and sends it to a local server, creating a significant risk for users who inadvertently include this package in their projects.

How To Fix

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

npm uninstall @selfpentest/bin-confusion

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 any scripts that invoke 'npm...' commands in your project until you have removed the malicious package. Additionally, you can manually check your package-lock.json file for any references to @selfpentest/bin-confusion and remove them.

Conclusion

The @selfpentest/bin-confusion package poses a significant security risk due to its malicious code that can exfiltrate sensitive information. It is essential for developers to remove this package from their projects and to utilize tools like Vulert for ongoing monitoring of vulnerabilities in their dependencies.

See every vulnerability recorded for @selfpentest/bin-confusion →

Share this vulnerability

FAQ

The vulnerability can lead to the exfiltration of sensitive information from your environment, including SSH keys and secrets, which can be exploited by attackers.

You can use Vulert, which monitors open-source vulnerabilities in your software. By simply uploading your package-lock.json file, you can receive real-time alerts about vulnerabilities.

To prevent similar vulnerabilities, regularly audit your dependencies and use tools like Vulert to monitor for known vulnerabilities in your packages.

If you have installed @selfpentest/bin-confusion, immediately uninstall it using 'npm uninstall @selfpentest/bin-confusion' and check your environment for any compromised data.

Yes, you can continue to use npm normally after removing the malicious package. Ensure that your other dependencies are secure and up to date.

How To Fix

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

npm uninstall @selfpentest/bin-confusion

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