Hacker News new | ask | show | jobs
by johannes1234321 3744 days ago
> > ● pre-install/post-install scripts should require user to accept or refuse. > > Presumably this would be unnecessary with 2FA for each publish operation.

2FA still doesn't mean you can trust the install script. Not running scripts automatically gives a chance to audit before they run.

And even with 2FA a worm could spread: It could manipulate the local npm installation so whenever you want to upload a package it will modify it during the publishing process giving you a 2nd-factor-request right when you expect it.

The only way to prevent that I can come up quickly is to over a chance to verify the package between signing (which npm doesn't support) and publishing.

1 comments

While I agree that giving people a chance to disable install scripts in order to audit them before / after running is a good idea, I also think it's somewhat optimistic of you to think that this would actually help.

There's plenty of npm packages that release updates weekly. I may not update them every time (I tend to wait until I see a need), but the rate of update is high enough that most people would just blindly click through after the fiftieth time they installed that package.