One thing I've never understood is why NPM allows packages to run code immediately after they are installed. What's the use case for that? A package should just be some code you can call on at runtime
Some packages need to build native dependencies. sharp for example needs to build libvips on the system [0] to work 0: https://github.com/lovell/sharp/blob/main/install/build.js
Malicious npm packages detected across Red Hat Cloud Services
181–190 of 494 posts
Re: Malicious npm packages detected across Red Hat Cloud Services
#182That’s why I switched to Java.
AbstractFinalFactoryShaiHuludSerialisedFactory
Re: Malicious npm packages detected across Red Hat Cloud Services
#183Earlier quoted context omitted.
Mosts packages manager, allow that. pnpm can still be exposed, afterall the worm simply have to wait you run tests locally.
I suppose. But that's a "Perfect is the enemy of good"-like argument. Wherein: Why even reduce an easy to exploit attack surface when there could be holes elsewhere?! Because, you know, it makes things much more secure even if imperfect. Plus, to me, it is a culture issue. npm just doesn't take security seriously, so we don't see these improvements, and if there was additional test hardening later, I don't expect we'…
I'm still trying to calibrate my take on this view.
If attacks are randomly chosen from the set of all potential vulnerabilities, without the attacker knowing which ones had been patched, then that logic clearly makes sense.
But in an adversarial situation where the attacker can guess which vulnerabilities you still have unpatched, or can try many different attack vectors, then having already patched some other vulnerabilities doesn't matter so much.
I guess reality is more complicated though.
Re: Malicious npm packages detected across Red Hat Cloud Services
#184I've made it a habit now to use the --before=2026-05-30 flag when installing packages, where it'll pick the version released before the date you specify, I usually pick around 5 days ago
Re: Malicious npm packages detected across Red Hat Cloud Services
#185Earlier quoted context omitted.
The problem would be the dependencies of your dependencies, and keep going many levels.
But presumably, you only include dependencies that you trust and those dependencies themselves do their trusting more strictly than you. Trust is built on vetting, signatures and reputation. That is, at least what we do, in theory. In practice, we cross fingers and let the LLM pick dependencies, are satisfied if it just works and we either update our deps frequently or infrequently.
https://news.ycombinator.com/item?id=47017833
Well, now with an irony, but sadly, of course.
Re: Malicious npm packages detected across Red Hat Cloud Services
#186'No Way to Prevent This,' Says Only package manager Where This Regularly Happens Edit: some people don't understand that it's a defence to https://en.wikipedia.org/wiki/%27No_Way_to_Prevent_This,%27_...
All programming language package managers are vulnerable. They all have the exact same caveats as the Arch Linux User Repository. There are no trusted maintainers taking responsibility for things. Any random person can make an account and push packages.
Re: Malicious npm packages detected across Red Hat Cloud Services
#187Re: Malicious npm packages detected across Red Hat Cloud Services
#188If this is what will take for folks to move away from JS ecosystem, I'll take it.
Re: Malicious npm packages detected across Red Hat Cloud Services
#189Our company uses yarn 4 which has an option to prevent you from installing an npm package for the first number of days of its release. Most of these seem to be caught within that timeframe (1-3 days). https://gist.github.com/mcollina/b294a6c39ee700d24073c0e5a4e...
uv supports the same for any Python developers out there: https://docs.astral.sh/uv/concepts/resolution/#dependency-co...
Re: Malicious npm packages detected across Red Hat Cloud Services
#190Earlier quoted context omitted.
What happens when everyone adopts this policy? You just change it to two weeks?
A large array of automated and semi-automated security scanners are finding things quickly. The main benefit of waiting before updating is to give those scanners time to work.