Skip to content

fix(pm): verify unpinned package-manager downloads against registry integrity - #3547

Merged
fengmk2 merged 7 commits into
voidzero-dev:mainfrom
jong-kyung:fix/verify-unpinned-pm-integrity
Nov 23, 2026
Merged

fengmk2 merged 7 commits into
voidzero-dev:mainfrom
jong-kyung:fix/verify-unpinned-pm-integrity

Conversation

@jong-kyung

@jong-kyung jong-kyung commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Without a packageManager hash, Vite+ installed npm, pnpm 11 and earlier, and Yarn without any integrity check. Bun and pnpm 12 and later already verified their platform tarball against the registry dist.integrity, so the same unpinned project was verified or not depending on the package manager. Corepack used to verify these downloads, and that check was lost when it was removed in #2391.

An unpinned download now fetches the version metadata and verifies the tarball against dist.integrity before extraction. A pinned download is unchanged. It is still verified against the pin and does not fetch metadata, which keeps the principle from #3400 that a declared pin takes precedence over what the registry reports.

…ntegrity

Without a `packageManager` hash, npm, pnpm 11 and earlier, and Yarn were
installed without any integrity check, while bun and pnpm 12+ already
verified their platform tarball against the registry `dist.integrity`.
Corepack used to verify these downloads before it was removed.

An unpinned download now fetches the version metadata and verifies the
tarball against `dist.integrity` before extraction. A pinned download keeps
using the pin and does not fetch metadata. A registry that omits
`dist.integrity` now fails the install with `MissingRegistryIntegrity`
for every manager, including the bun and pnpm 12+ platform tarballs.
@jong-kyung jong-kyung self-assigned this Nov 23, 2026
@jong-kyung jong-kyung added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: create-e2e Run `vp create` e2e tests test: sfw labels Nov 23, 2026
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T05:21:43.678511Z bfba722 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Match the existing bun and pnpm 12+ platform tarball behavior instead of
failing the install, so a mirror without dist.integrity keeps working.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: edf37a510e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/vp_pm_cli/src/package_manager.rs Resolved
The test served only the tarball, so the new metadata request returned 404
before the temp dir existed and the cleanup assertion passed vacuously.
Use is_not_found for registry 404 mapping, name managers by
PackageManagerType, and share the test sri and mount helpers. Remove doc
and inline comments that restate the code.
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 75fc3cc5d8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jong-kyung
jong-kyung marked this pull request as ready for review November 23, 2026 05:15
An unpinned npm download now reads dist.integrity from the version
metadata, so the mock registry must answer that request.
@jong-kyung
jong-kyung marked this pull request as draft November 23, 2026 05:17
@jong-kyung
jong-kyung marked this pull request as ready for review November 23, 2026 05:18
@fengmk2
fengmk2 merged commit fc8cf35 into voidzero-dev:main Nov 23, 2026
147 of 149 checks passed
@jong-kyung
jong-kyung deleted the fix/verify-unpinned-pm-integrity branch November 23, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: sfw

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants