npm

The clamp4js npm Attack

Updated 26 Nov 2026 · Incident date 25 Nov 2026

The clamp4js package uses its install script to fetch Windows installers and signal a link shortener.

Installing this clamp helper runs a hidden download in your shell. Computers and CI runners that installed any affected version were exposed.

What happened

The package is a one-function clamp helper, but its install script fetches and stores two Windows installers and calls out to a shortener. None of that has anything to do with clamping a number.

  • The postinstall script races downloads of Microsoft Edge and Google Chrome installers from their vendor addresses.
  • It writes the first response into a random-named file in the system temp folder.
  • It then fetches https://urlto.me/2rrih, a fixed beacon.
  • The script hides its addresses: it splits them into joined strings and passes them through a decode function built on two number tables.
  • Version 1.0.9 emptied the script and version 1.0.13 turned it back on with the beacon.

Vigilance caught version 1.0.9 at 20:39 UTC on 25 November 2026, 1 minute 9 seconds after it appeared on npm. The first affected version, 1.0.5, appeared 5 minutes 37 seconds before the catch.

Affected versions

  • 1.0.5 added the postinstall downloader (setup.js).
  • 1.0.9 renamed it to install.js and left it dormant.
  • 1.0.13 turned the download back on and added the beacon.
  • Versions 0.0.0-stage and 1.0.2 had an empty install script.

Indicators of compromise

  • A postinstall script that runs node install.js (or node setup.js in 1.0.5).
  • Requests to c2rsetup.officeapps.live.com/c2r/downloadEdge.aspx and dl.google.com/installers/ChromeSetup.exe from an npm install.
  • Requests to https://urlto.me/2rrih in 1.0.13.

How to check

Run this outside the project, and check which version your lockfile records.

npm ls clamp4js

Check your CI build logs and lockfile history for versions 1.0.5 through 1.0.13. A clean install today cannot rule out earlier exposure.

What to do now

  1. Remove clamp4js, or pin a clean version such as 1.0.2.
  2. Check the temp folder of any machine that installed an affected version for unknown files.
  3. Review network logs for requests to the addresses above from build machines.

What Vigilance would show

These examples show an install hold and the corresponding owner report.

Example install message

Vigilance blocked `clamp4js` 1.0.9. This version is too new or changed in a way Vigilance must check first.

Example owner report

Bad update

clamp4js 1.0.9

The install script downloads Windows installers into a random temp file and beacons a link shortener.

See what to do now.

No security team? See who reads the alert.

Frequently asked questions

What does clamp4js do?

Its published code clamps a number between two values. Its install script does something else entirely: it downloads Windows installers and beacons a link shortener.

Did the install script run the downloaded files?

In version 1.0.13 the script loads the child process module but does not call it, so the installers are dropped, not run. Treat any machine that installed an affected version as exposed.

Sources

  1. registry.npmjs.org/clamp4js

Send this page to the person who looks after AI at your company.

Email it

More supply chain attacks

All 202 attacks in the library · npm supply chain attacks · How to prevent supply chain attacks

Check the next update before you install it

Vigilance compares the version you trust with the new one. It names the one file that gained a power the old version did not have.

Start freeBrowse the attack library