chore(security): npm supply-chain cooldown + pnpm 11.5.1 - #101
Merged
Conversation
Harden the dependency supply chain against compromised npm releases. - pnpm-workspace.yaml: add `minimumReleaseAge: 10080` (7-day cooldown) so pnpm refuses any dependency version published less than 7 days ago, the window in which malicious releases are almost always detected and unpublished. Exempt our own `@yourgpt/*` packages. - Upgrade pnpm 9.15.0 -> 11.5.1 (minimumReleaseAge needs pnpm >= 10.16). - Migrate `pnpm.overrides` from package.json to `overrides` in pnpm-workspace.yaml (pnpm >= 10 no longer reads the package.json "pnpm" field). - Add `onlyBuiltDependencies` allowlist for trusted native build scripts (esbuild, sharp, @parcel/watcher, workerd, unrs-resolver, msw); pnpm >= 10 blocks dependency lifecycle scripts by default. - CI backstop: dependency-age-gate workflow + scripts/check-dependency-age.mjs fails any PR introducing a dependency version younger than the cooldown, enforced regardless of the package manager/pnpm version used. Pure Node builtins, no third-party actions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Rohitjoshi9023
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Rising npm supply-chain attacks (compromised maintainer accounts pushing malicious patch releases). This adds a dependency cooldown so we never install a version that's brand-new — the window where malicious releases are almost always caught and unpublished — plus a CI backstop to enforce it.
What
1. Cooldown gate (pnpm official
minimumReleaseAge) —pnpm-workspace.yamlminimumReleaseAge: 10080→ refuse any dependency version (incl. transitive) published < 7 days ago.minimumReleaseAgeExclude: ["@yourgpt/*"]→ our own first-party packages are exempt.pnpm installnow reports "Verifying lockfile against supply-chain policies … ✓ passes."2. pnpm 9.15.0 → 11.5.1 —
package.jsonpackageManagerminimumReleaseAgeneeds pnpm ≥ 10.16. (pnpm/action-setup@v4in CI reads this field automatically.)3. pnpm 11 migration fallout handled
pnpm.overrides(@types/react*pins) →overrides:inpnpm-workspace.yaml(pnpm ≥ 10 no longer reads the package.jsonpnpmfield — these pins would have silently stopped applying).onlyBuiltDependenciesallowlist for trusted native build scripts (esbuild,sharp,@parcel/watcher,workerd,unrs-resolver,msw) — pnpm ≥ 10 blocks dependency lifecycle scripts by default. Anything new requesting a build script is now blocked pending review.4. CI enforcement backstop —
.github/workflows/dependency-age-gate.yml+scripts/check-dependency-age.mjsNotes for reviewers
minimumReleaseAge: 10080(minutes) and the workflow'sCOOLDOWN_DAYS: "7"are the same 7 days (days × 1440 = minutes). Noted in comments in both files.onlyBuiltDependencies.main(notbeta) to keep this isolated from the 8 in-flight beta release commits. You'll likely want to land the same hardening onbetatoo.🤖 Generated with Claude Code