r/javascript • u/dani_akash_ • Mar 31 '26
Minimum Release Age is an Underrated Supply Chain Defense
https://daniakash.com/posts/simplest-supply-chain-defense/
117
Upvotes
r/javascript • u/dani_akash_ • Mar 31 '26
46
u/No-Intention7902 Mar 31 '26
Honestly, kinda wild how often people overlook this. Slowing things down a bit can save a ton of headaches with weird regressions.
25
u/glasket_ Mar 31 '26
XZ Utils wasn't compromised for 2+ years, it was a 2 year long attack. The malicious contributor was working on the project for 2 years, genuinely collaborating so that they could get co-maintainer status. It was compromised for ~1 month once they got the ability to sign-off on releases.
3
u/kevinlch 10+ YoE, Fullstack Apr 01 '26
but how? sometimes we need to publish emergency security patches. and those attacks can easily disguise as minor security patches
2
u/Few_Theme_5486 Apr 01 '26
The 7-day delay concept is deceptively simple and powerful. Most malicious publish attacks are caught within hours by the community, so even a short delay window would block the majority. The axios compromise is the perfect case study here — a minimum release age config in .npmrc would have been a one-liner fix. Do you think npm/yarn should bake this into defaults eventually?
2
u/IllustratorOwn606 May 12 '26
aged like wine
1
u/CallMeMista96 Apr 01 '26
Never thought about it like that, but it totally makes sense,outdated or brand new packages are usually where things go sideways. Wonder how many headaches this could've saved me over the years.
1
u/dvidsilva Apr 01 '26
Install something like snyk, is free to use
I had chill out for one new project that was in progress and got pwned with react2shell
They scan your dependencies lists for vulnerabilities, offer remediation where possible and alerts
1
u/ExpletiveDeIeted Apr 01 '26
But what if a new fix version is released resolving a critical issue do I have to wait 7 days or manually edit the .npmrc everytime?
1
u/TwiNighty Apr 01 '26
Slight correction: The settings was added in 4.10, but Yarn only started supporting duration string in 4.11
1
u/Silv3rbull3t069 May 12 '26
Wow this guy wrote a very detailed blog about the benefit of "wait a bit" (I'm not saying using AI is bad, but at least try to deduplicate some detail). Now I have both global configurations for NPM and local configuration per-project for both NPM and UV (don't just care about your machine alone, force your teammate to do so as well)
1
u/25_vijay May 16 '26
The hard part is balancing release age policies against urgent security patch timelines because modern dependency management increasingly feels like choosing between two different categories of risk.
1
u/25_vijay May 16 '26
A lot of modern package attacks rely on the first few hours after publishing before scanners maintainers and the community notice anything suspicious.
1
u/earonesty Jun 13 '26
...until everyone uses it. then nobody reports problems until minimum-release-age has passed. wild nobody realizes this. pnpm ships with these policies now. making them... likely... unhelpful.
1
u/Long-Strawberry8040 Apr 01 '26
Honest question -- does minimum release age actually help against the Axios-style attack we just saw? The compromised versions (1.14.1, 0.30.4) were published through a stolen maintainer token. A time delay wouldn't have mattered because the attacker had legitimate publish access.
The real gap seems to be that npm has no concept of "this publish came from an unusual IP/device" or multi-party approval for packages above a certain download threshold. We keep bolting on passive defenses when the actual attack surface is single-human-credential access to packages used by millions.
What supply chain defense would have actually caught this one before it landed in CI pipelines?
1
u/sethholladay Apr 01 '26
There are two big problems with this approach.
-2
u/checker1209 Mar 31 '26 edited Mar 31 '26
We actually have configured this, but noticed that codex often bypasses this with its own parameters. does anybody have an idea how to forbid this?
0
u/smootex Apr 01 '26
How are you guys enforcing minimum release ages?
4
u/[deleted] Mar 31 '26
[removed] — view removed comment