Repository navigation
fix(npm): verify launcher downloads against checksums pinned at publish - #115
Merged
Merged
Conversation
The launcher only checked each binary against a .sha256 sidecar served from the same GitHub release. A release replaced wholesale would pass that check. At prepublish, scripts/pin-checksums.mjs now hashes every release binary, checks it against its sidecar, and writes checksums.json into the package. The launcher requires the downloaded bytes to match the pinned hash too, and refuses when the pinned file is missing or for a different version. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 25 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
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.
Summary
The launcher verified each download only against a
.sha256sidecar from the same GitHub release. A release replaced wholesale would pass that check.scripts/pin-checksums.mjsruns inprepublishOnly(after the GitHub release exists). It downloads every platform binary, hashes the bytes, checks each hash against the release sidecar, and writeschecksums.jsoninto the package.lib/download.mjsrequires the downloaded bytes to match the pinned hash as well, and refuses when the pinned file is missing or is for another version.allAssetNames()lists all five platform assets so the pin covers every platform.Publish order
The GitHub release for
v<version>must exist beforenpm publish, because the pin step downloads its binaries.Verification
node --test tests/*.test.mjs: 33/33 pass, including new tests for version and missing-entry refusal, a binary that matches its sidecar but not the pin (refused), a genuine binary (installed), and pin-script disagreement.scripts/pin-checksums.mjs 0.0.0-devrefuses.🤖 Generated with Claude Code