▲ | dns_snek 5 days ago | |||||||
Whenever I read this well-meaning advice I have to ask: Do you actually read hundreds of thousands of lines of code (or more) that NPM installed? Because the workflow for 99.99% of developers is something resembling: 1. git clone 2. npm install (which pulls in a malicious dependency but disabling post-install scripts saved you for now!) 3. npm run (executing your malicious dependency, you're now infected) The only way this advice helps you is if you also insert "audit the entirety of node_modules" in between steps 2 and 3 which nobody does. | ||||||||
▲ | IshKebab 4 days ago | parent [-] | |||||||
Yeah I guess it probably helps you specifically, because most malware is going to do the lazy thing and use install scripts. But it doesn't help everyone in general because if e.g. NPM disabled those scripts entirely (or made them opt-in) then the malware authors would just put their malware into the `npm run` as you say. | ||||||||
|