Skip to content

feat: set default minimumReleaseAge to 1 day (1440 minutes)#11158

Merged
zkochan merged 9 commits into
pnpm:mainfrom
sotanengel:feat/default-minimum-release-age-3days
Apr 4, 2026
Merged

feat: set default minimumReleaseAge to 1 day (1440 minutes)#11158
zkochan merged 9 commits into
pnpm:mainfrom
sotanengel:feat/default-minimum-release-age-3days

Conversation

@sotanengel

@sotanengel sotanengel commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

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 cooldown period would have blocked most of them automatically.

What This PR Does

Sets the default minimumReleaseAge to 1440 minutes (1 day = 24 × 60).

  • Before: packages are installable immediately after publishing
  • After: packages must be at least 1 day old before they can be installed by default
  • Opt-out: users can set minimumReleaseAge: 0 in pnpm-workspace.yaml to restore the previous behavior

Compliance Alignment

References

@sotanengel sotanengel requested a review from zkochan as a code owner March 31, 2026 20:16
Copilot AI review requested due to automatic review settings March 31, 2026 20:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Sets a non-zero default for pnpm’s “cooldown” security feature so newly published package versions are not immediately eligible for installation unless users opt out.

Changes:

  • Set the default minimum-release-age config value to 4320 minutes (3 days).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread config/reader/src/index.ts Outdated
Comment thread config/reader/src/index.ts Outdated
Comment thread config/reader/src/index.ts Outdated
@sotanengel

Copy link
Copy Markdown
Contributor Author

Addressed the Copilot review feedback in commit 5fe0f86:

  1. Missing Changeset: Added .changeset/default-minimum-release-age.md with minor bumps for @pnpm/config.reader and pnpm.

  2. Test Coverage: Added two tests in config/reader/test/index.ts:

    • Verifies minimumReleaseAge defaults to 4320 (3 days)
    • Verifies users can override it to 0 via .npmrc using the correct kebab-case key minimum-release-age=0
  3. Docs key format: The PR description used camelCase; the correct opt-out in .npmrc is minimum-release-age=0 (kebab-case), which is also confirmed by the new test.

Comment on lines +2 to +3
"@pnpm/config.reader": minor
"pnpm": minor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's a major change.

@zkochan zkochan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could ship it in v11. However, the biggest problem is that the publish time of a package is only available in the non-abbreviated package document. This document is much bigger than he abbreviated one. Hence, this change would make installation slower.

@sotanengel

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! Updated the changeset to major.
I'd like to target this for v11 as you suggested — is there a v11 branch I should base this PR on?

@sotanengel sotanengel force-pushed the feat/default-minimum-release-age-3days branch from 277c546 to 1ed1852 Compare March 31, 2026 21:30
sotanengel and others added 3 commits April 4, 2026 01:52
…ly chain attack protection

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@zkochan zkochan force-pushed the feat/default-minimum-release-age-3days branch from 1ed1852 to 4c00bde Compare April 3, 2026 23:52
@zkochan zkochan changed the title feat: set default minimumReleaseAge to 3 days (4320 minutes) feat: set default minimumReleaseAge to 1 day (1440 minutes) Apr 3, 2026
@zkochan

zkochan commented Apr 3, 2026

Copy link
Copy Markdown
Member

Poll results show that most of the users want some delay: https://x.com/pnpmjs/status/2039099810943304073

@sotanengel

Copy link
Copy Markdown
Contributor Author

Thanks. Let me know if you’d like me to make any follow-up changes from my side🙇

@zkochan zkochan merged commit c7203b9 into pnpm:main Apr 4, 2026
8 checks passed
@welcome

welcome Bot commented Apr 4, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

@mbtools

mbtools commented Apr 7, 2026

Copy link
Copy Markdown

I understand that recent events have triggered this but imho changing this default is a VERY BAD idea.

It effectively blocks all patches of all known security issues for everyone for 24 hours vs. blocking still relatively rare supply chain attacks that impact some projects some of the time. This puts every project using pnpm 11 at an exponentially greater risk at all times!

It's nice that the setting exists but it must remain off by default.

Reverse this, please 🙏

@zkochan

zkochan commented Apr 7, 2026

Copy link
Copy Markdown
Member

This is a setting that you can change to your personal liking. The default value of the setting was decided by a vote, where the majority wanted some delay by default.

@mbtools

mbtools commented Apr 7, 2026

Copy link
Copy Markdown

Please refer me to the voting results? Who voted?

@zkochan

zkochan commented Apr 7, 2026

Copy link
Copy Markdown
Member

The poll was referenced in my message above: https://x.com/pnpmjs/status/2039099810943304073

image

@zkochan zkochan added this to the v11.0 milestone Apr 7, 2026
@mbtools

mbtools commented Apr 7, 2026

Copy link
Copy Markdown

I love pnpm but this choice is bonkers.

600 "people" on xwitter is what should represent the community? and no background information given to the "voters"? sorry, but lol.

Malicious actors will have a blast. They can simply scan repos for pnpm-workspace.yaml and the missing minimumReleaseAge: 0 setting. Then pick any vuln in the deps and have a guaranteed 24 hours to attack with a high rate of success. That's the opposite of "security by default".

I'm fairly certain that we will regret this change. Good luck

@zkochan

zkochan commented Apr 7, 2026

Copy link
Copy Markdown
Member

Your style of communication is unprofessional. Hence, I don't feel motivated to discuss this matter with you.

@pnpm pnpm locked as too heated and limited conversation to collaborators Apr 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants