Verify sccache downloads by default #8
No reviewers
Labels
No labels
backlog
blocked
blocked:upstream
ci
converted
docs
enhancement
opportunity
p1
p2
p3
parked
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
rasterstate/sccache-action!8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "verify-sccache-downloads"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the row-13 download integrity finding.
Confirmed against current main before patching. The installer documented checksum verification as opt-in:
It downloaded the tarball before any verification:
And the sidecar verification path was gated only by
SCCACHE_VERIFY_CHECKSUM=true, otherwise falling back to transport trust:Changes:
SCCACHE_VERIFY_CHECKSUMdefaulting to truev0.15.0Linux/macOS assetsverify-checksum: falseas an insecure escape hatch with a loud warningsha256enforced even when verification is disabledLocal verification:
shellcheck scripts/install.sh scripts/install-hooks.sh tests/run.sh tests/checksum-mismatch.sh .githooks/pre-commit .githooks/commit-msgmake testmake test-integrationLocal note:
make allcannot complete in this environment becauseshfmtandactionlintare not installed;shellcheckand both test targets pass.Adversarial review: APPROVE
Reviewed at head
5d7f7baagainstmain. I wrote the row-13 finding, so I went looking for a cosmetic fix; this is a real one. All five requirements hold, verified by readingscripts/install.sh, running the suite, and exercising the real download path.(1) On by default, verified before execution.
verify_checksum="${SCCACHE_VERIFY_CHECKSUM:-true}"(install.sh:25) andaction.ymlwiresSCCACHE_VERIFY_CHECKSUM: ${{ inputs.verify-checksum }}withdefault: 'true'. Only the exact stringfalsedisables it; any other value verifies (fail-safe). Ordering is correct: download (:104) → verify (:119-184) →tar -xzf(:186) → install (:196) →sccache --version(:214). The binary is never extracted or executed before the digest is checked.(2) Fails closed with no verification source. Sidecar fetch failure with no built-in pin and no explicit
sha256exits 1 (:169-171), and a catch-allif [ "$verified" != "true" ]exits 1 (:180-183). The mirror path (download-base-url) also fails closed: the built-in pin is skipped for a mirror, so a mirror serving neither sidecar norsha256hits:169-171. Covered by new tests 18 and 19.(3) The pins are real, not theater. All four
v0.15.0pins match the actualmozilla/sccacherelease.sha256sidecars, fetched live:The pin-table keys (
x86_64-unknown-linux-musl, etc.) exactly match the triplesinstall.shcomputes (:76-86), so the pin actually fires on the default asset rather than silently missing.(4) Opt-out is explicit and loud. Disabling requires
verify-checksum: falseexactly;install.sh:152printsSECURITY WARNING: checksum verification explicitly disabled...to stderr, and an explicitsha256is still enforced even then (:153-155).action.ymldocuments it as an "explicit insecure escape hatch." Test 21 asserts the warning.(5) Docs match reality. README, SECURITY.md, and
action.ymlall now describe "built-in release pins and the upstream sidecar by default," and SECURITY.md correctly calls the built-in pin the stronger protection (the sidecar shares the tarball's origin). Consistent with the code.Evidence
bash tests/run.sh: 30/30 pass, including the two new fail-closed cases and the escape-hatch warning.PATHso the download path actually runs:sha256→ exit 1,sha256 input mismatch, nothing installed (actual hash was the genuine782d…).pinned sha256 ok+checksum sidecar ok, verified binary installed.curlserving a poisoned tarball and a matching poisoned sidecar on the default github path): rejected withpinned sha256 mismatch, poisoned binary not installed. This is exactly the sidecar-is-TOFU-from-the-same-origin gap row 13 raised, and the built-in pin (shipped in git, not fetched) defeats it.Non-blocking notes (follow-ups, not merge blockers)
v0.15.0only. Bumping theversioninput to an unlisted release silently downgrades to sidecar-only on the github path (still fails closed if the sidecar is absent, but a coordinated release-page swap on that version would not be caught). Worth extending the table when the default version bumps, or a comment noting pins track the default asset.download-base-url), the pin is intentionally skipped, so mirror integrity rests on the mirror's sidecar or an explicitsha256. Reasonable, and already documented in SECURITY.md.Fix is real and complete. APPROVE for merge.