fix(security): add SHA-256 checksum verification for curl-downloaded context-bar.sh#19
Closed
xiaolai wants to merge 1 commit intoykdojo:mainfrom
Closed
fix(security): add SHA-256 checksum verification for curl-downloaded context-bar.sh#19xiaolai wants to merge 1 commit intoykdojo:mainfrom
xiaolai wants to merge 1 commit intoykdojo:mainfrom
Conversation
…context-bar.sh setup.sh downloads context-bar.sh from the live GitHub branch and immediately marks it executable. If the upstream repo or CDN were compromised between releases, the tampered script would execute on every Claude Code prompt via the statusLine hook. Add an integrity check after the download: - Hardcode the expected SHA-256 of the current script - Abort and delete the file if the hash does not match - Works on both Linux (sha256sum) and macOS (shasum -a 256) Update this hash whenever context-bar.sh is intentionally changed. Co-Authored-By: Claude Code <noreply@anthropic.com>
This was referenced Apr 20, 2026
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
scripts/setup.sh(remote mode) downloadscontext-bar.shfrom the live GitHub branch and immediately marks it executable:This script runs on every Claude Code prompt via the
statusLinehook. If the upstream repo, CDN, or GitHub's raw serving layer were ever tampered with between releases, the modified script would execute silently with user privileges.Fix
Add a SHA-256 integrity check between the download and
chmod:sha256sum) and macOS (shasum -a 256)When
context-bar.shis intentionally updated, bump theEXPECTED_SHA256value in this file at the same time.Test plan
bash scripts/setup.shin remote mode — confirm context-bar.sh installs successfullysha256sum/shasum -a 256both work on the target platform