Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Verify SHA256 checksums for managed toolchain downloads #1744

Copy link
Copy link

Description

@shaanmajid
Issue body actions

Problem

prek downloads and executes toolchain binaries without verifying integrity. A corrupted CDN cache, truncated download, or tampered artifact installs silently.

Five of the six managed toolchain upstreams publish SHA256 checksums:

Toolchain Checksum source
Node SHASUMS256.txt from nodejs.org/dist/
Bun SHASUMS256.txt from GitHub release assets
Go sha256 field in go.dev/dl/?mode=json
Rustup .sha256 sidecar files alongside each binary
uv (from github) .sha256 sidecar files alongside each binary
Ruby (rv-ruby) None published

Proposed solution

Fetch the upstream checksum before download. Compute SHA256 while streaming to a temp file. Reject on mismatch before extraction. Fail closed: if the checksum is unavailable, malformed, or mismatched, abort the install.

This requires refactoring the download pipeline from streaming-into-extractor to download-then-verify-then-extract.

I have a draft PR covering Node, Bun, Go, and Rustup.

Notes

  • Ruby (rv-ruby) does not publish checksums. A self-hash fallback (hash on first download, detect changes on subsequent installs) could cover this gap separately.
  • Node and Bun also publish GPG signatures for their checksum files. Verifying those would close the same-origin trust gap for those two toolchains, but requires embedding public keys and a PGP verification dependency. Worth considering as a follow-up.
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.