Malicious code in @selfpentest/bin-confusion (npm)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (40a68543ca2674f2b90d89dd52516736791b7886d617c694d89dd3135e7499f3) package.json registers a `bin` entry named `npm` pointing at npm.js, deliberately colliding with the core npm CLI. Once this package is installed as a dependency, any `npm...` invocation in a consuming project's scripts resolves via node_modules/.bin to this shim, executing the shipped code before (or instead of) the real npm. npm.js contains a `steal()` routine that reads process.env.HOME, process.env.SECRET, and the first 30 bytes of ~/.ssh/known_hosts, concatenates them into a query string, and issues a fetch GET to http://localhost:1337/. The destination is loopback in this build, but the collected data (installer SSH known_hosts contents and environment secrets) is packaged into a functioning exfiltration primitive that fires whenever the shadow `npm` shim is invoked from the installer's build scripts. The scope name (`@selfpentest`) and README frame this as a demonstration, but the shipped tarball is a working bin-shadow + credential-read + network-send chain against installers who add it as a dependency.
MAL-2026-17292
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:MAL-2026-17292
@selfpentest/bin-confusion
Source reference: /affected/0/package/name
- Affected versions
- 1.0.1
Source reference:
/affected/0/versions1.0.0Source reference:
/affected/0/versions - Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"package": {
"name": "@selfpentest/bin-confusion",
"purl": "pkg:npm/%40selfpentest/bin-confusion",
"ecosystem": "npm"
},
"versions": [
"1.0.1",
"1.0.0"
],
"database_specific": {
"cwes": [
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
},
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
}
],
"source": "https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/@selfpentest/bin-confusion/MAL-2026-17292.json",
"indicators": {
"evidence_files": [
{
"path": "package.json",
"tlsh": "a0e0c2174e12246314e819651c39417bb52a8f6b285ebd652bffa20c92cd3bb643564c",
"sha256": "57e36195d9df49781c8fd45bf2f25f79950a80c0564fc2d90399397529b0c699"
},
{
"path": "npm.js",
"tlsh": "4a41004620f11a3886b222a3779b24033afbd0a73215cca475dc8671df5af758261dfa",
"sha256": "f82f3e8a084d7d4c833daf350c1ae17534841c6d540f138fe573a5dedfed572b"
}
],
"package_integrity": [
{
"hashes": {
"sha1": "7253b6b5cecfbdc5fec4eca9e304ed25f68bb86a",
"sha512_sri": "sha512-+jfVd+b1JHd8zttc8dXEdmFOoR2hmFLkQGXSmZwCDG7XdBr4d5W2adh6eOZJWZ8FTMr/A41pSA16ABSKLNxGZQ=="
},
"filename": "bin-confusion-1.0.1.tgz"
}
]
}
}
}
]Publisher severity
No explicit severity was provided.
- Event
- #31935 · Revision 1
- Added to Heist Feed
- Publisher date