Hosted preview: results below were recorded from real runs of the demo on a local machine. Nothing runs on this server. To try your own payloads, run it locally with npm run demo.

nodejs-supply-chain-security

What a malicious npm package can do on install, and the settings that stop it. View on GitHub

Recorded runs · nothing executes on this server

A malicious dependency steals your tokens on npm install

A fake package, totally-legit-utils, has a postinstall script that collects tokens from the environment. Both sides really run npm install on it (offline, in a temp folder, with fake tokens).

Fake tokens in the environment:

Fix: ignore-scripts=true in .npmrc, then npm rebuild <pkg> only for packages you've reviewed.

Find every package that runs code on install

A project's node_modules holds a clean package, a nested one with a preinstall, a native addon (binding.gyp), and one piping a script from the internet into a shell. The scanner here is the real scripts/find-install-scripts.js.

Fix: run the scanner in CI and fail the build when a new install script appears; allowlist only what you've reviewed.

Limit what code can do with the Node permission model

The same script tries to read files, write files, and spawn a process. With --permission, every door is closed unless you open it with an --allow-* flag. Tick a grant to open one.

Extra grants for the safe side:

Fix: start services with node --permission and grant only the folders and capabilities they need.