fix(security): crawler URL scheme check + hookinstaller perms#19
Merged
fix(security): crawler URL scheme check + hookinstaller perms#19
Conversation
Addresses 3 open code-scanning alerts: - CodeQL go/incomplete-url-scheme-check (high): crawler's denylist only covered mailto:/javascript: — data:, vbscript:, tel:, file:, blob: could slip through. Replaced with an http(s)-only allow-list on the parsed URL scheme (case-insensitive). Added table-driven tests. - SonarCloud go:S2612 (x2): hookinstaller wrote config with 0o644 and hook scripts with 0o755 — both world-readable. Tightened to 0o600 / 0o700 since these files live in the user's own ~/.claude dir and only the owner needs access. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
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
Fixes 3 open code-scanning alerts:
internal/crawler/crawler.go:277. Denylist only covered `mailto:` / `javascript:`, so `data:`, `vbscript:`, `tel:`, `file:`, `blob:` slipped through. Replaced with an http(s)-only allow-list on the parsed scheme (case-insensitive).Added table-driven tests for the crawler fix (13 scheme cases).
Test plan