logoalt Hacker News

efortistoday at 10:19 AM4 repliesview on HN

Mitigate this attack vector by adding:

    ignore-scripts=true
to your .npmrc

https://blog.uxtly.com/getting-rid-of-npm-scripts


Replies

hiccuphippotoday at 4:21 PM

Is there a way to list all the packages in the dependency tree with preinstall/postinstall hooks? Preferably before doing the installation?

show 1 reply
TeMPOraLtoday at 4:02 PM

Stupid question, but:

- If it's safe to "ignore scripts", why does this option exist in the first place?

- Otherwise, what kind of cascade breakage in dependencies you risk by suppressing part of their installation process?

show 1 reply
seanwilsontoday at 1:46 PM

Once you run the JavaScript of the npm library you just installed, if it's Node, what's to stop it accessing environment variables and any file it wants, and sending data to any domain it wants?

show 2 replies
philipwhiuktoday at 1:38 PM

Or use pnpm

show 1 reply