logoalt Hacker News

raggitoday at 2:17 AM4 repliesview on HN

install scripts are a distraction, just like package signatures are a distraction. adding/removing either feature has no significant impact on the wormability of this package ecosystem. installed npm code is run, with nearly zero exceptions.


Replies

nine_ktoday at 2:32 AM

The installed code may be run in different settings, under a different user, with different privileges. Say, it may not run in CI/CD at all, or run only with the test user's privileges.

Postinstall scripts run at install time, with installer's privileges.

piperswetoday at 2:31 AM

A lot of it ends up bundled to run in a browser though, and doesn't end up running in Node.js

827atoday at 3:33 AM

> There's a huge difference, because postinstall scripts are almost guaranteed to run in your CI pipeline. Compromised code probably won't (maybe it will if your test cases test a compromised package). Different attack profile. Worse in some ways (your CI likely has NPM push tokens, which is how this single-package worm become a multi-package self-replicating worm) (your CI pipeline also likely has some level of privileged access to your cloud environment; deployed services are more likely to be highly scoped). But, better in some ways.

show 1 reply
throwaway27448today at 2:31 AM

Surely every layer of defense in depth is a distraction except the one that prevents the problem.

show 1 reply