Live data from Hacker News

Show HN: Safe-NPM – only install packages that are +90 days old

github.com

31–40 of 69 posts

Re: Show HN: Safe-NPM – only install packages that are +90 days old

#31
post #21

With the help of AI, i see no reason to install most deps nowadays besides types and react and mui framework. Everything can be built from scratch quickly.

I think this is a pretty common approach nowadays, and one of the reasons why I believe my job is safe for now. I expect to be called up to fix some of the resulting mess. It's a two-edged sword, for sure.

Re: Show HN: Safe-NPM – only install packages that are +90 days old

#32

As someotherguyy already mentioned, this is a default feature in pnpm. And as far as cat-and-mouse-games go in other package managers, I'd say that pinning dependencies and disabling postinstall scripts is a much better option. Sure, not a foolproof one either, but as good as it gets. edit: misspelled someotherguyy's user name

I recently learned that this is (for all intents and purposes) a feature in npm as well, specifically the `--before` flag to `npm install`: https://docs.npmjs.com/cli/v11/commands/npm-install#before. That was harder than it should've been to figure out; it really needs better marketing.

Related to that is the proposal for `stabilityDays`, which seems way more practical: https://github.com/npm/cli/issues/8570#issuecomment-33004136.... So rather than merely saying "I only want package versions more than N days old", you'd be adding the requirement that "...and also they should have gone at least N days without a subsequent patch release". e.g. if mylib@6.0.0 is released, only to be quickly followed by 6.0.1 and 6.0.2, you ideally wouldn't want to risk ever installing the probably-broken 6.0.0 or 6.0.1 based on luck of the draw; the better behavior would be to stick with the last 5.x release until 6.0.2 has aged past the threshold.

Re: Show HN: Safe-NPM – only install packages that are +90 days old

#34

Earlier quoted context omitted.

Why is the community persisting with such poor solutions?

What would be a better solution? Do other package managers reliably restrict access to the host system beyond the scope of the project folder? Many quirks come from abilities that were once deemed useful, such as compiling code in other languages after package install. Sure, today, I can disable install scripts if I want but it doesn't change much when I eventually run code from the package anyway. But even restricti…

Deno has capabilities, but I don't use it so I don't know if they are useful in practice or if everyone just always allows everything.

Re: Show HN: Safe-NPM – only install packages that are +90 days old

#35

This works only if there are some other people, who will use a dependency "too early" to fall victim to some exploit and then notice it, within those 90 days. Imagine, if everyone only used packages older than 90 days. Then we would have no frontrunner to run into the issues before us. A cooldown time alone is not actually a sufficient solution. What people really need to stop doing, is not properly pinning their ver…

Yes and no, usually when malicious packages go public it's some third party cybersecurity firm that scans packages that found it.

Re: Show HN: Safe-NPM – only install packages that are +90 days old

#38
Now with 9000% more zero-days!

> Installs the newest "aged" version

Probably want to install version that has CVE-fixed instead, i.e find the cve for packages and install latest version that has all of them fixed but not later.

Technically someone could fake a cve to get people to upgrade but that's a far more involved process

Re: Show HN: Safe-NPM – only install packages that are +90 days old

#39

Why does elapsed time mean a library is safe? This is so ridiculous. It doesn't protect you against anything. I'm sure there are 1000s of old libraries out there with hidden vulnerabilities or malicious code.

hedging bets of zero day vs compromise (that have big chance to be found in thos e 90 days). But yeah, not a good idea

Re: Show HN: Safe-NPM – only install packages that are +90 days old

#40
post #21

With the help of AI, i see no reason to install most deps nowadays besides types and react and mui framework. Everything can be built from scratch quickly.

Now you have shifted your supply chain issues to your coding agent.
Post reply on HN