▲ | philipwhiuk 5 hours ago | ||||||||||||||||
post-install seems like it shouldn't be necessary anyway, let alone need shell access. What are legitimate JS packages using this for? | |||||||||||||||||
▲ | homebrewer 5 hours ago | parent | next [-] | ||||||||||||||||
From what I've seen, it's either spam, telemetry, or downloading prebuilt binaries. The first two are anti-user and should not exist, the last one isn't really necessary — swc, esbuild, and typescript-go simply split native versions into separate packages, and install just what your system needs. Use pnpm and whitelist just what you need. It disables all scripts by default. | |||||||||||||||||
▲ | eknkc 5 hours ago | parent | prev | next [-] | ||||||||||||||||
Does that even matter? The malware could have been a JS code injected into the module entry point itself. As soon as you execute something that imports the package (which, you did install for a reason) the code can run. I don't think that many people sandbox their development environments. | |||||||||||||||||
| |||||||||||||||||
▲ | tln 3 hours ago | parent | prev | next [-] | ||||||||||||||||
I think these compromises show that install hooks should be severely restricted. Something like, only packages with attestations/signed releases and OIDC-only workflow should allow these scripts. Worm could propogate through the code itself but I think it would be quite a bit less effective. | |||||||||||||||||
▲ | vinnymac 4 hours ago | parent | prev [-] | ||||||||||||||||
Most don’t need it. There was a time when most post installing flooded your terminal with annoying messages to upgrade, donate, say hi. Modern node package managers such as yarn and pnpm allow you to prevent post installs entirely. Today most of the time you need to make an exception for a package is when a module requires native compilation or download of a pre-built binary. This has become rare though. |