Malicious code in clamp4js (npm)
- MAL-2026-20645
Description
Show the whole descriptionHide the whole description
clamp4js runs a postinstall script on `npm install`. In 1.0.5 (`setup.js`) and 1.0.13 (`install.js`) the script decodes two strings that look like Edge and Chrome installer URLs into hxxps://pastebin[.]com/raw/z6K1Rg8J and hxxps://calcal[.]ru/p/t5edjvR/raw, downloads whichever responds first and writes the response to a randomly named file in the temporary directory. The scripts do not execute the downloaded file. 1.0.13 additionally sends a GET request to hxxps://urlto[.]me/2rrih after the file is written. In 1.0.2 and 1.0.9 the loader is empty or disabled. The same stage URLs are used by clampony (MAL-2026-20433). On 2026-11-25 the first URL served an obfuscated Node.js script (SHA-256 ca2b7eced5937817b2aca2d50542d2e171bc95593be72a94c158616ed17a5334) that only runs on win32. It copies Telegram Desktop data, SSH keys, AWS, Google Cloud, Azure, Kubernetes, Docker, Terraform, npm, PyPI, Poetry, Git and GitHub CLI credentials, FileZilla, WinSCP and MobaXterm data and shell histories into a zip archive and uploads it to a Telegram bot (bot ID 9249894009, chat ID 7638757988), directly or through nine HTTP proxies. It also downloads hxxps://195.123.6.29:443/enterotoxin[.]exe to the temporary directory, starts it hidden and detached, and deletes the file after six seconds. clamp4js@1.0.5 ships six files and declares an npm lifecycle hook at package.json line 16 ("postinstall": "node setup.js"). Because postinstall runs automatically as part of `npm install`, the bundled setup.js executes on every installing developer machine or build agent with the installing user's privileges, before any consumer code imports or invokes the package, and without any user action beyond installing the dependency. The install-time script is the package's dominant install-time effect: no declared library entry behavior is required for setup.js to run. The code reached through this hook matches patterns associated with operational install-time payload execution rather than ordinary build or asset-preparation work for a small utility of this size, and the package provides no documented justification for requiring privileged automatic execution at install time.
Text from the OSV record.
Affected
clamp4jsnpm
- all versions, no fix listed
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.