npm

The PureScript npm Installer Sabotage

Updated 5 Oct 2026 · Incident date 5 Jul 2019

load-from-cwd-or-npm 3.0.2 and rate-map 1.0.3 on npm made the PureScript installer hang instead of finishing, in July 2019.

Both packages belonged to a former author of the installer. The code did not steal data.

What happened

The PureScript installer downloads a prebuilt compiler. Its maintainers took over from the original author, Shinnosuke Watanabe (@shinnn), after a disagreement.

  • load-from-cwd-or-npm@3.0.2 returned a PassThrough stream instead of the expected package.
  • The installer then hung at the step that checks for a prebuilt binary.
  • rate-map@1.0.3 removed callback behavior and then deleted itself.
  • The code ran only when the PureScript installer used it.

Version 3.0.2 went up on 5 July 2019 at about 21:00 UTC. A user found the problem on 9 July at about 01:00 UTC. Clean 3.0.4 followed at about 05:00 UTC.

Affected versions

  • load-from-cwd-or-npm 3.0.2. Clean 3.0.4 followed.
  • rate-map 1.0.3.
  • The PureScript npm installer before the fix, which depended on these packages.
  • The registry removed both malicious versions. PureScript 0.13.2 or later is fixed.

Indicators of compromise

  • load-from-cwd-or-npm version 3.0.2 in a lockfile or node_modules.
  • rate-map version 1.0.3 in a lockfile or node_modules.
  • An install of purescript that hangs at the message "Check if a prebuilt binary is provided for your platform".

How to check

List the two packages in your dependency tree.

npm ls load-from-cwd-or-npm rate-map

Search lockfiles for the bad versions.

grep -rnE "load-from-cwd-or-npm|rate-map" package-lock.json yarn.lock 2>/dev/null

What to do now

  1. Update purescript to 0.13.2 or later.
  2. Remove or update load-from-cwd-or-npm and rate-map so that no bad version remains.
  3. Reinstall dependencies from a clean lockfile.

What Vigilance would show

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

Example install message

Vigilance blocked `load-from-cwd-or-npm` 3.0.2. This version is too new or changed in a way Vigilance must check first.

Example owner report

Bad update

load-from-cwd-or-npm 3.0.2

One helper can now overwrite other packages' files on disk, quietly breaking a rival project's download step.

See what to do now.

No security team? See who reads the alert.

Frequently asked questions

What did the malicious packages do?

They made the PureScript installer hang during the prebuilt binary check. The sources do not describe data theft.

Which versions were malicious?

load-from-cwd-or-npm 3.0.2 and rate-map 1.0.3.

Sources

  1. harry.garrood.me/blog/malicious-code-in-purescript-npm-installer/
  2. theregister.com/2019/07/15/purescripts_npm_installer/

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

Email it

More supply chain attacks

All 172 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 the free 14-day trialBrowse the attack library