cvelo
P2 · HighMalware

Malicious code in @xokodon430/jsclamp (npm)

  • MAL-2026-20498

Description

Show the whole description

@xokodon430/jsclamp copies the code and README of the npm package clamp and adds a preinstall script (`node setup.js`) that runs automatically on `npm install`. In 1.0.2, setup.js downloads a second stage from https://pastebin.com/raw/z6K1Rg8J, falling back to https://calcal.ru/p/t5edjvR/raw; the function that would write the download to a random file in the temporary directory and run it is empty, so the stage is fetched but not executed. In 1.0.3 the URL list is empty and the script exits without network activity. setup.js in 1.0.2 is byte-identical to that of clampony 1.0.9 (MAL-2026-20433), and both packages use the same second-stage URLs; that record describes the second stage as a credential stealer that collects Telegram Desktop sessions, SSH keys and cloud and package-registry credentials and sends them to a Telegram bot. The package was published from a newly created account on 2026-11-24. Remediation: remove the package, block the URLs above, and if it was installed, treat credentials on that machine as exposed and rotate them. The package is advertised as a one-line numeric clamp utility but ships a preinstall lifecycle hook (`node setup.js`) that, on `npm install`, fetches bytes from https://pastebin.com/raw/z6K1Rg8J and https://calcal.ru/p/t5edjvR/raw (first-successful wins), writes them to a random path under the OS tmpdir, and passes the resulting file to a `run()` function. The destinations are author-mutable paste hosts unrelated to the package's stated publisher, and the content is unpinned and unverified. In version 1.0.2 the `run()` function is an empty stub so the fetched bytes are not executed, but the full dropper scaffolding — preinstall trigger, dual-source fetch with failover, staging under tmpdir, handoff to a runner — is present and reachable. Error reporting is obfuscated: HTTP failures surface as `Error #<status*13579>` and `process.exit(1)`, concealing which remote host failed and masking that preinstall is reaching Pastebin/calcal.ru. None of this behavior is justified by a 7-line clamp utility.

Text from the OSV record.

Affected

  • @xokodon430/jsclampnpm

    • all versions, no fix listed

Timeline

  1. Published

Related news

No article from the followed outlets names this vulnerability.