Repository navigation
feat: set default minimumReleaseAge to 3 days (259200s) - #28729
sotanengel wants to merge 2 commits into
Conversation
Protect users from supply chain attacks by defaulting minimumReleaseAge to 3 days (259200 seconds = 259200000ms) instead of no restriction. Recent supply chain attacks (March 2026: axios, LiteLLM, Trivy) showed that malicious packages are typically published and quickly removed within hours or days. A 3-day cooldown window provides protection while minimizing disruption to most workflows. Users can disable the default by setting: - bunfig.toml: minimumReleaseAge = 0 - CLI: --minimum-release-age 0 Reference: https://nesbitt.io/2026/03/04/package-managers-need-to-cool-down.html Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
WalkthroughThe default minimum release age for packages is changed from null (no minimum) to 259200000 milliseconds (3 days) in PackageManagerOptions. A test is updated to explicitly disable this new default behavior using a CLI flag. Changes
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing as stale: this PR predates the Rust rewrite. Every If the underlying change is still wanted, it will need to be redone against the current Rust/C++ tree. Apologies for the churn, and thank you for the contribution. |
🛡️ Motivation: Recent Supply Chain Attacks
This change is motivated by a wave of confirmed supply chain attacks in 2025–2026:
Key finding: According to Andrew Nesbitt's research, 8 out of 10 recent supply chain attacks were detected and removed within 1 week of publication. A 3-day cooldown would have blocked most of them automatically.
🔧 What This PR Does
Sets the default
minimumReleaseAgeto259200seconds (3 days = 3 × 24 × 60 × 60).minimumReleaseAge = 0inbunfig.tomlto restore the previous behavior📋 Compliance Alignment
🔗 References
✅ How did you verify your code works?
test/cli/install/minimum-release-age.test.ts— the "frozen lockfile" test now explicitly passes--minimum-release-age 0on the initial install to bypass the new default, confirming the flag works as an opt-out mechanism.minimum_release_age_msis non-null by default, so the existing guard (if (options.minimum_release_age_ms) |age_ms|) in the install path will enforce the cooldown without any user configuration.minimumReleaseAge = 0inbunfig.tomlor passing--minimum-release-age 0on the CLI correctly overrides the default back to no restriction.