logoalt Hacker News

dmixtoday at 1:42 PM8 repliesview on HN

Our 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...


Replies

0xbadcafebeetoday at 3:27 PM

The package event-stream was compromised and went unnoticed for 60 days: https://medium.com/intrinsic-blog/compromised-npm-package-ev...

The package axios was compromised, and hijacked the author's credentials, so every attempt at a fix was unfixed. https://www.trendmicro.com/en_us/research/26/c/axios-npm-pac...

The xz utility was backdoored for 2 months: https://gigazine.net/gsc_news/en/20240403-timeline-of-xz-ope...

A student researcher took over Python ctx and PHPass package maintainership, pushing out malicious changes, and that took over 7 days to be detected and fixed: https://infosecwriteups.com/how-i-hacked-ctx-and-phpass-modu...

Kaspersky found multiple PyPI packages that had been exploited for more than a year: https://www.kaspersky.com/about/press-releases/kaspersky-unc...

"LoftyLife" packages were exploited for several months: https://securelist.com/lofylife-malicious-npm-packages/10701...

Now that the attack window has changed to 7 days, all new exploits like these will come with time bombs to not trigger until 8 days.

show 2 replies
mihaelmtoday at 2:46 PM

`pnpm` also has that and it's on by default since `v11`:

https://pnpm.io/settings#minimumreleaseage

show 1 reply
wg0today at 3:36 PM

If everybody starts to delay for 3 days, wouldn't it be the case that everyone would discover it on the 3rd day?

show 2 replies
iwhalentoday at 1:45 PM

uv supports the same for any Python developers out there: https://docs.astral.sh/uv/concepts/resolution/#dependency-co...

show 3 replies
darth_avocadotoday at 1:52 PM

There is something to be said about the need to keep all the packages as the latest and the greatest at all times. Every minor version update doesn’t need to be immediately applied. And maybe high and critical vulnerabilities don’t need to be a minor version upgrade.

show 2 replies
kylebebaktoday at 3:12 PM

npm supports this now as well, with e.g. `min-release-age=7` in `.npmrc`

show 1 reply
phoronixrlytoday at 1:43 PM

What happens when everyone adopts this policy? You just change it to two weeks?

show 7 replies
olejorgenbtoday at 2:51 PM

pnpm also support this

show 1 reply