LWA-2026-14536 confirmed malware

clamp4js@1.0.5

Malicious code in clamp4js (npm)

T1195.002 · Compromise Software Supply ChainT1059.007 · JavaScriptT1027 · Obfuscated Files or InformationT1036 · MasqueradingT1105 · Ingress Tool Transfer

Analysis

clamp4js@1.0.5 presents itself as a numeric clamp utility — index.js exports a pure min/max clamp function — but its package.json registers a postinstall hook, `node setup.js`, that downloads Windows installer executables. setup.js requires node:fs/promises, node:os, node:path, node:crypto and node:child_process, and instantiates a downloader over two sources: hxxps://c2rsetup[.]officeapps[.]live[.]com/c2r/downloadEdge[.]aspx (Microsoft Edge installer) and hxxps://dl[.]google[.]com/installers/ChromeSetup[.]exe (Chrome installer). It issues both requests with fetch, resolves them with Promise.any, aborts the remaining request, then writes the first successful response body into os.tmpdir() under a crypto.randomUUID() filename. The download URLs are not stored as plain strings: a normalize() routine rebuilds each one from a 33-byte coefficient table using an additive modulo-257 recurrence, with the "P" table used when the source name contains "officeapps" and the "C" table otherwise, and it logs the resulting temp path and buffer to the install console. The hook exits with process.exit(1) on failure. The package also declares dependencies on uclamp (spec ^0.0.0-stage) and undici that no shipped file imports. Install-time fetching of executable binaries via runtime-decoded URLs is unrelated to the package's stated arithmetic function.

analyzed by
Leitwacht
first seen
Nov 26, 2026, 02:06 AM
analyzed
Nov 26, 2026, 02:07 AM

Related advisories

browse all confirmed advisories →

Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.