Skip to content

Verify SHA256 checksum before installing just-lsp binary#40

Open
abumalick wants to merge 1 commit intojackTabsCode:mainfrom
abumalick:add-checksum-verification
Open

Verify SHA256 checksum before installing just-lsp binary#40
abumalick wants to merge 1 commit intojackTabsCode:mainfrom
abumalick:add-checksum-verification

Conversation

@abumalick
Copy link
Copy Markdown

Summary

  • Downloads SHA256SUMS from the just-lsp release and verifies the archive checksum before extracting
  • Prevents supply chain attacks via tampered binaries on GitHub releases
  • Adds sha2 crate dependency for hash computation

How it works

  1. Fetches SHA256SUMS from the release assets
  2. Downloads the archive via http_client::fetch and computes its SHA256
  3. Compares against the expected hash — aborts with a clear error on mismatch
  4. Only then proceeds with download_file for extraction

Trade-off

The archive is downloaded twice (once for verification, once for extraction via download_file which is the only API available for tar.gz/zip extraction in the WASM sandbox). This is a one-time cost per version and worth it for supply chain security.

Download SHA256SUMS from the release and verify the archive
checksum before extracting, preventing supply chain attacks
via tampered binaries.
Copilot AI review requested due to automatic review settings April 13, 2026 06:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds SHA256 checksum verification for the just-lsp release archive prior to installation to improve supply-chain integrity.

Changes:

  • Introduces sha2 dependency and computes SHA256 for the downloaded release archive.
  • Fetches SHA256SUMS from release assets and compares expected vs computed hash before proceeding.
  • Updates download error formatting for download_file.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/lib.rs Fetches SHA256SUMS + archive, computes SHA256, compares, then proceeds to download/extract.
Cargo.toml Adds sha2 dependency for hashing.
Cargo.lock Locks transitive dependencies introduced by sha2.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib.rs
Comment thread src/lib.rs
Comment thread src/lib.rs
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.

2 participants