Skip to content

fix(security): crawler URL scheme check + hookinstaller perms#19

Merged
aksOps merged 2 commits intomainfrom
fix-code-scanning
Apr 23, 2026
Merged

fix(security): crawler URL scheme check + hookinstaller perms#19
aksOps merged 2 commits intomainfrom
fix-code-scanning

Conversation

@aksOps
Copy link
Copy Markdown
Contributor

@aksOps aksOps commented Apr 23, 2026

Summary

Fixes 3 open code-scanning alerts:

  • CodeQL go/incomplete-url-scheme-check (high)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).
  • SonarCloud go:S2612 (medium, x2) — `internal/hookinstaller/installer.go`. Config tightened `0o644 → 0o600`, hook script `0o755 → 0o700`. These live in `~/.claude` — only the owner needs access.

Added table-driven tests for the crawler fix (13 scheme cases).

Test plan

  • `go test ./internal/crawler/... ./internal/hookinstaller/...` passes locally
  • CI passes

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>
@aksOps aksOps enabled auto-merge (squash) April 23, 2026 00:00
@aksOps aksOps merged commit 84f23f5 into main Apr 23, 2026
12 checks passed
@aksOps aksOps deleted the fix-code-scanning branch April 23, 2026 00:48
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