Skip to content

feat: set default min-release-age to 3 days#9173

Open
sotanengel wants to merge 1 commit intonpm:latestfrom
sotanengel:feat/default-min-release-age-3days
Open

feat: set default min-release-age to 3 days#9173
sotanengel wants to merge 1 commit intonpm:latestfrom
sotanengel:feat/default-min-release-age-3days

Conversation

@sotanengel
Copy link
Copy Markdown

@sotanengel sotanengel commented Mar 31, 2026

🛡️ Motivation: Recent Supply Chain Attacks

This change is motivated by a wave of confirmed supply chain attacks in 2025–2026:

Incident Date Impact
Shai-Hulud npm Worm Sep 2025 200+ npm packages compromised via stolen GitHub tokens; secrets exfiltrated from CI/CD
Trivy GitHub Actions Compromise Mar 2026 Build pipeline of the popular security scanner hijacked; malicious script injection risk
Polyfill.io Domain Hijack Ongoing Domain acquisition used to distribute malicious JS to 100,000+ websites
axios npm Compromise Mar 2026 Maintainer account takeover; RAT-infected version published

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 value of min-release-age from null (disabled) to 3 (days).

  • Before: packages are installable immediately after publishing
  • After: packages must be at least 3 days old before they can be installed by default
  • Opt-out: users can set min-release-age=0 in .npmrc to restore the previous behavior

📋 Compliance Alignment

🔗 References

…rotection

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sotanengel sotanengel requested a review from a team as a code owner March 31, 2026 20:17
@sotanengel sotanengel closed this Mar 31, 2026
@sotanengel sotanengel reopened this Mar 31, 2026
@sotanengel sotanengel force-pushed the feat/default-min-release-age-3days branch from a164633 to 0ed504a Compare March 31, 2026 21:33
Copy link
Copy Markdown

@booniepepper booniepepper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, although for people/organizations with private repositories (or similar use cases), they'll need the ability to scope this value to specific registries

@sotanengel
Copy link
Copy Markdown
Author

@booniepepper
Thanks for raising this — the security motivation makes sense!

Could you share what direction you’re considering for handling registry scoping? If there’s something specific I can help evaluate or test, I’d be happy to support.

@booniepepper
Copy link
Copy Markdown

I'm most familiar with private repositories in a corporate environment. Cloudsmith, GitHub packages, AWS CodeArtifact, etc

Generally the pattern I've seen is to use these for internal-only packages, either libraries specific to some internal details, or CLI tools specific to an organization's internal auth and opinionated tool stacks

@sotanengel
Copy link
Copy Markdown
Author

@booniepepper
That matches my experience as well — private registries are usually used for internal libraries and tooling where immediate availability is often expected as part of the workflow!

Because of that, it might make sense to allow min-release-age to be configured per registry, rather than applying a single global default.

For example:

registry=https://registry.npmjs.org/
min-release-age=3

@internal:registry=https://npm.company.local/
min-release-age=0

Would this approach align with what you had in mind?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants