livekit-cli icon indicating copy to clipboard operation
livekit-cli copied to clipboard

fix(install): verify release checksum before extracting in install-cli.sh

Open mcdgavin opened this issue 5 months ago • 0 comments

Summary

install-cli.sh piped the downloaded archive straight into tar with no integrity check. This downloads the archive and the release's checksums.txt, verifies the archive's SHA-256 against the published checksum (failing closed on a missing or mismatched checksum), then extracts.

Scope / honest caveat

checksums.txt is fetched from the same release over HTTPS, so this guards against corrupted/partial downloads and accidental mismatches — it is not a substitute for signature verification against an out-of-band key. The stronger follow-up would be to sign checksums.txt (e.g. cosign/sigstore via goreleaser) and verify the signature here. I'm happy to do that separately if you'd like to enable signing.

Test

Verified against the v2.16.6 release: the checksum parse + match succeeds on the real archive, and a tampered archive is correctly rejected. bash -n passes. (The script is Linux-only — it aborts on macOS — so it relies on sha256sum, with an added presence check.)

Fixes #647

Thanks to @xtreme-sameer-vohra for raising it.

mcdgavin avatar Jun 17 '26 17:06 mcdgavin