Skip to content

ci: add 2-day npm supply-chain cooldown (min-release-age)#291

Merged
epeicher merged 1 commit into
trunkfrom
ci/npm-min-release-age
Jun 3, 2026
Merged

ci: add 2-day npm supply-chain cooldown (min-release-age)#291
epeicher merged 1 commit into
trunkfrom
ci/npm-min-release-age

Conversation

@epeicher
Copy link
Copy Markdown
Collaborator

@epeicher epeicher commented Jun 3, 2026

Why

Follow-up supply-chain hardening after #290. Adds a publication "cooldown" so npm will not resolve any dependency version that was published less than 2 days ago. This gives the ecosystem time to detect and unpublish a malicious release before it can be pinned into our lockfile, the propagation path behind the recent self-replicating npm worms.

What

One line in .npmrc:

min-release-age=2

The value is in days.

How it behaves

  • npm consumes min-release-age at config-load time and derives before = now - 2 days, recomputed on every invocation (a rolling window, not a frozen date).
  • It filters resolution only: npm install / npm update and Dependabot-style bumps won't pick a brand-new version.
  • npm ci is unaffected, verified with a dry-run producing a byte-identical install plan with and without the setting, because it installs already-resolved versions straight from package-lock.json. All three CI jobs use npm ci, so CI behavior does not change.
  • No conflict with npm's exclusive rule between min-release-age and before: we only set min-release-age and npm derives before itself.

Operational note

The 2-day window can occasionally make npm install <brand-new-package> or a same-day npm update fail to resolve until the version ages past the cutoff. The fix is a one-off --min-release-age=0 (or --before="") on that single command, not a config change.

Open WordPress Playground Preview

Add `min-release-age=2` to .npmrc so npm will not resolve any dependency
version published less than 2 days ago. This gives the ecosystem time to
detect and unpublish a malicious release before it can be pinned into our
lockfile, the propagation vector behind recent self-replicating npm worms.

npm consumes this at config-load time and derives `before = now - 2 days`,
so it filters resolution only: `npm install` / `npm update` and Dependabot
bumps won't pick a brand-new version. `npm ci` is unaffected (verified via
dry-run: byte-identical install plan), since it installs already-resolved
versions straight from package-lock.json.
@epeicher epeicher enabled auto-merge (squash) June 3, 2026 08:30
@epeicher epeicher merged commit 37cbe0c into trunk Jun 3, 2026
5 checks passed
@epeicher epeicher deleted the ci/npm-min-release-age branch June 3, 2026 08:31
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.

1 participant