fix(hooks): pin the cbm installer's sha256 instead of fetching it - #136
Merged
Conversation
The installer verified the downloaded codebase-memory-mcp tarball against a checksums.txt fetched from the same GitHub release as the tarball. That proves the download wasn't corrupted in transit; it proves nothing about the publisher. Anyone able to alter the release alters both files together and verification still passes. Replaced with per-arch sha256 values pinned in the script. A hash committed here is an independent reference: it fails closed if the tag is ever re-pointed or the asset re-uploaded. This matters more than usual because cbm-code-discovery-gate executes the binary on every PreToolUse once the hook is registered — a swapped artifact would run constantly, not once. It is also the pattern this repo's own gitleaks workflow already uses (pinned by version AND tarball sha256), so this is consistency rather than novelty. An arch with no pinned hash is now a hard stop rather than a fall-through to an unverified install. Provenance: both linux tarballs were downloaded and sha256sum'd locally, and the computed digests matched the release's checksums.txt. The pinned values are the computed ones, not transcribed. Mirrors crm-pipeline NousResearch#266.
🔎 Lint report:
|
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.
What does this PR do?
Follow-up to #135. Closes a supply-chain gap in the installer that PR added. Mirrors crm-pipeline #266, which has the byte-identical file — verified before writing this.
.claude/hooks/session-start.shverified the downloadedcodebase-memory-mcptarball against achecksums.txtfetched from the same GitHub release as the tarball:That proves the download wasn't corrupted in transit. It proves nothing about the publisher — anyone who can alter the release alters both files together, and verification still passes.
It matters more than usual here:
cbm-code-discovery-gateruns the binary on every PreToolUse once the hook is registered. A swapped artifact would execute constantly, not once.Related Issue
Follow-up to #135 (same investigation that produced #134).
Type of Change
Changes Made
Per-arch sha256 values pinned in the script. A hash committed in the repo is an independent reference — it fails closed if the tag is ever re-pointed or the asset re-uploaded.
An arch with no pin is now a hard stop, not a fall-through to an unverified install.
This is the pattern this repo's own gitleaks workflow already uses (#116: pinned by version and tarball sha256), so it's consistency rather than novelty.
Provenance of the pinned values
Both linux tarballs were downloaded and
sha256sum'd locally; the computed digests matched the release'schecksums.txtforlinux-amd64andlinux-arm64. The pinned values are the computed ones, not transcribed — otherwise this would just relocate the same unverified trust from runtime into the repo.How to Test
Verification
Run against the identical crm-pipeline file —
bash -nclean, plus four cases against a freshHOME:codebase-memory-mcp 0.9.0Case 3 is the one that matters — a verifier that never fails closed is decoration.
No Python touched.
Follow-up not in this PR
The
/Users/danizhaky/.local/binsymlink remains a workaround for a Mac-absolute path hardcoded in.claude/settings.jsonand the cbm-* hooks. Un-hardcoding that path is the real fix; the symlink is debt.Generated by Claude Code