| ▲ | raggi 25 days ago | |||||||||||||||||||||||||||||||||||||||||||||||||
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. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | nine_k 25 days ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
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. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | piperswe 25 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
A lot of it ends up bundled to run in a browser though, and doesn't end up running in Node.js | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | throwaway27448 25 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
Surely every layer of defense in depth is a distraction except the one that prevents the problem. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | 827a 25 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
> 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||