Skip to content

fix(install): make bootstrap installer checksum verification fail closed - #2

Open
jfischer-motivity wants to merge 2 commits into
mainfrom
claude/jolly-khorana-fb04b8
Open

fix(install): make bootstrap installer checksum verification fail closed#2
jfischer-motivity wants to merge 2 commits into
mainfrom
claude/jolly-khorana-fb04b8

Conversation

@jfischer-motivity

Copy link
Copy Markdown
Owner

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.txt couldn'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-binary update command failed closed. This contradicted the SHA-256 verification claim in SECURITY.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-checksum on the shell installers) — is provided for local development against unsigned test builds, with a warning.

Changes

File Change
install.sh Fail-closed checksum block; --skip-checksum flag + env bypass. Also || true on the grep so set -e/pipefail doesn't abort before the "not found" message
install.ps1 Same, PowerShell idiom. Also switched 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 runs via -File on Windows PowerShell 5.1)
pkg/npm/install.js verifyChecksum now 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 the bin shim linked; bin.js re-verifies on first run)
pkg/pypi/src/codebase_memory_mcp/_cli.py _verify_checksum now sys.exits on any unverifiable state (this file was not flagged in the review but had the identical fail-open pattern)
SECURITY.md Updated the checksum claim to cover all installers and document fail-closed behavior + bypass

Verification

Each installer was exercised end-to-end (not just syntax-checked):

  • install.sh — 6 scenarios against a local release server: valid → verified & installed; mismatch / missing-checksums / archive-not-listed → aborted, no binary written; env & flag bypass → warn & install.
  • install.ps1 — full AST parse + 4 scenarios via -File: all aborts fire with correct messages; bypass proceeds past verification.
  • install.js — 6 cases with stubbed https: valid resolves; mismatch / 404 / network-error / not-listed all throw; bypass resolves.
  • _cli.py — 5 cases with monkeypatched urlretrieve: same results.

Out of scope

Other review findings (Windows /api/process-kill, UI CSRF/auth, /api/browse scoping, pinned internal releases) are not addressed here — this PR is scoped to recommendation #2 only.

🤖 Generated with Claude Code

jfischer-motivity and others added 2 commits July 10, 2026 15:39
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant