Skip to content

fix(install): require npm provenance for platform packages - #2440

Open
kazupon wants to merge 3 commits into
voidzero-dev:mainfrom
kazupon:issue-1826-platform-package-provenance
Open

fix(install): require npm provenance for platform packages#2440
kazupon wants to merge 3 commits into
voidzero-dev:mainfrom
kazupon:issue-1826-platform-package-provenance

Conversation

@kazupon

@kazupon kazupon commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #1826.

Vite+ previously accepted platform package metadata without requiring npm provenance, allowing an unverified release binary to reach the download path.

Require supported SLSA provenance before downloading standard release binaries through the standalone installers, vp upgrade, and vp-setup.exe.

Changes

  • Validate dist.attestations.provenance.predicateType against SLSA v1 and v0.2 in the shared Rust resolver.
  • Fetch and validate exact platform metadata in both standalone installers.
  • Fail closed before tarball download for missing, malformed, spoofed, or unsupported provenance.
  • Add one mock registry fixture and entrypoint coverage for all four install and upgrade paths.

Testing

  • cargo test -p vp_setup registry: provenance parsing, error classification, and download ordering.
  • just check, just test, just lint: workspace compilation, tests, and Clippy.
  • Mock-registry E2E: rejection before download and acceptance of SLSA v1/v0.2 across the installer and upgrade entrypoints.
  • Official npm release smoke test: an existing provenance-backed release still installs.

@netlify

netlify Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 478793c
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a7de4ca2dbf260008a108ab

@kazupon
kazupon marked this pull request as ready for review August 13, 2026 06:03
@kazupon
kazupon requested a review from fengmk2 August 13, 2026 06:28
@kazupon

kazupon commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 3c8979569f

ℹ️ 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 packages/cli/install.sh Outdated
fail_json("expected colon in JSON object")
}
json_pos++
child_path = path == "" ? key : path "." key

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Track JSON paths structurally before trusting provenance

When a platform package is published outside the trusted release flow, it can include a top-level package field named dist.attestations.provenance.predicateType with an accepted value. Because this parser represents paths by concatenating raw keys with ., that field is indistinguishable from the genuine nested npm provenance field; combined with the registry-supplied dist.tarball, install.sh passes the gate and downloads an unprovenanced binary. Track path segments or structural depth separately so dots inside package-defined keys cannot satisfy the provenance check.

Useful? React with 👍 / 👎.

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.

Reject Vite+ install script if the @voidzero-dev/vite-plus-cli-* package does not have provenance

1 participant