fix(install): make bootstrap installer checksum verification fail closed - #2
Open
jfischer-motivity wants to merge 2 commits into
Open
fix(install): make bootstrap installer checksum verification fail closed#2jfischer-motivity wants to merge 2 commits into
jfischer-motivity wants to merge 2 commits into
Conversation
The four first-install paths (install.sh, install.ps1, npm postinstall, PyPI shim) previously treated checksum verification as best-effort: if checksums.txt could not be fetched, the archive was missing from the list, or (in the shell installer) no SHA-256 tool was available, they silently skipped verification and installed the binary anyway. Only the in-binary `update` command failed closed. Make all four abort rather than install an unverified binary when a positive checksum match cannot be obtained. An explicit bypass — CBM_SKIP_CHECKSUM=1 (or --skip-checksum on the shell installers) — is provided for local development against unsigned test builds, with a warning. This aligns the installers with the fail-closed `update` flow and the SHA-256 verification claim in SECURITY.md, which is updated to match. Also switch the PowerShell installer's new error strings from em-dashes to ASCII hyphens: em-dashes inside double-quoted strings break parsing when the shipped UTF-8 (no BOM) script is run via `-File` on Windows PowerShell 5.1, which mis-decodes the multibyte character. Verified end-to-end: valid checksum installs; mismatch, unavailable checksums, and archive-not-listed all abort with no binary written; bypass warns and proceeds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add install-pinned.sh / install-pinned.ps1 for controlled internal distribution. Unlike install.sh/install.ps1, which track the "latest" upstream release, these wrappers pin the download to a specific release (v0.8.1 — the version synced to this fork and reviewed for security) by exporting CBM_DOWNLOAD_URL to that release's versioned asset path, then delegate to the fork's install.sh/install.ps1. Because those launchers now verify checksums fail-closed, a teammate gets exactly the vetted build or a hard abort — never an unverified binary. The launcher ref defaults to `main` and is overridable via CBM_INSTALL_REF (e.g. a commit SHA for a fully immutable launcher). All install.sh/install.ps1 flags are forwarded. README documents the team/pinned install and notes this verifies integrity against a pinned checksums.txt; full authenticity still requires verifying the release's cosign/SLSA attestations. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses recommendation #2 from the security review: make install verification fail closed.
The four first-install paths previously treated SHA-256 checksum verification as best-effort — if
checksums.txtcouldn't be fetched, the archive was missing from the list, or (in the shell installer) no hash tool was available, they silently skipped verification and installed the binary anyway. Only the in-binaryupdatecommand failed closed. This contradicted the SHA-256 verification claim inSECURITY.md.All four now abort rather than install an unverified binary when a positive checksum match can't be obtained. An explicit bypass —
CBM_SKIP_CHECKSUM=1(or--skip-checksumon the shell installers) — is provided for local development against unsigned test builds, with a warning.Changes
install.sh--skip-checksumflag + env bypass. Also|| trueon thegrepsoset -e/pipefaildoesn't abort before the "not found" messageinstall.ps1-Fileon Windows PowerShell 5.1)pkg/npm/install.jsverifyChecksumnow throws on any unverifiable state — it runs before the binary is copied, so no unverified binary is ever placed; documented why postinstall still exits 0 (keeps thebinshim linked;bin.jsre-verifies on first run)pkg/pypi/src/codebase_memory_mcp/_cli.py_verify_checksumnowsys.exits on any unverifiable state (this file was not flagged in the review but had the identical fail-open pattern)SECURITY.mdVerification
Each installer was exercised end-to-end (not just syntax-checked):
-File: all aborts fire with correct messages; bypass proceeds past verification.https: valid resolves; mismatch / 404 / network-error / not-listed all throw; bypass resolves.urlretrieve: same results.Out of scope
Other review findings (Windows
/api/process-kill, UI CSRF/auth,/api/browsescoping, pinned internal releases) are not addressed here — this PR is scoped to recommendation #2 only.🤖 Generated with Claude Code