Skip to content

install.sh and install.ps1 install the binary without checking the published .sha256 #3003

Closed

Description

@joshhickson

Every release publishes a .sha256 beside each compiler binary, and the README points to them ("Binaries, checksums and provenance are on the releases page"). The installers don't use them: scripts/install.sh downloads with curl -fsSL "$url" -o "$tmp_bin" and moves it into place (lines 40-42), and scripts/install.ps1 does the same with Invoke-WebRequest and Move-Item (lines 38-39); install.cmd runs install.ps1. Both then run the binary (with version), so a truncated or altered download is installed and executed as it is.

Proposed: fetch <asset>.sha256 from the same release, compare its first field with the download's SHA-256 before the move, and on a mismatch delete the download and exit non-zero, naming both hashes. That's sha256sum, or shasum -a 256 on macOS, in install.sh, and Get-FileHash -Algorithm SHA256 in install.ps1.

Only the first field can be compared: the release workflow writes shasum -a 256 "out/release/<asset>" (.github/workflows/nightly-release.yml lines 449 and 710), so the file's second field is the CI path, out/release/with-windows-x86_64.exe for instance, and sha256sum -c beside the download wouldn't find the file.

Checked on main 32bf4438 and the v0.16.0.8 assets.

Activity

  1. added 2 commits that reference this issue on Nov 7, 2026
  2. ehartford commented on Nov 7, 2026

    @ehartford
    Contributor

    Fixed in #3065 (baff8e4): scripts/install.sh and scripts/install.ps1 fetch <asset>.sha256, compare its first field with the download's SHA-256 (sha256sum or shasum -a 256; Get-FileHash), and on a mismatch remove the download and exit non-zero naming both digests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions