Skip to content

fix: Resolve CodeQL security findings#15

Merged
raifdmueller merged 2 commits intomainfrom
fix/codeql-security-issues
Feb 20, 2026
Merged

fix: Resolve CodeQL security findings#15
raifdmueller merged 2 commits intomainfrom
fix/codeql-security-issues

Conversation

@raifdmueller
Copy link
Owner

Summary

Fixes all 5 CodeQL security findings found after enabling CodeQL (LLM-Coding#84).

Findings fixed

# File Rule Severity Fix
3x anchor-modal.js js/client-side-request-forgery error Validate anchorId with regex before fetch
1x router.js js/unvalidated-dynamic-method-call warning Validate anchorId from URL hash before passing on
1x website.spec.js js/regex/missing-regexp-anchor warning Anchor GitHub URL regex with ^https:// prefix

Details

anchor-modal.js: anchorId from the URL hash was used directly in fetch() calls. Now validated against /^[a-z0-9]+(?:-[a-z0-9]+)*$/ — only lowercase alphanumeric + hyphens allowed. Invalid IDs show an error message instead. Also validates lang code before use.

router.js: Same validation applied to anchorId extracted from the route path before passing to showAnchorDetails().

website.spec.js: /github\.com.*edit//^https:\/\/github\.com\/.+\/edit\/.+/ to prevent partial host matching.

Test plan

  • npm run lint — 0 errors
  • npm run test — 70 unit tests pass
  • CodeQL scan shows 0 findings
  • E2E tests pass

🤖 Generated with Claude Code

raifdmueller and others added 2 commits February 20, 2026 12:52
- anchor-modal.js: Validate anchorId against safe pattern before use
  in fetch() URLs (fixes js/client-side-request-forgery x3)
  Also validate lang code before use in URL
- router.js: Validate anchorId from URL hash before passing to
  showAnchorDetails (fixes js/unvalidated-dynamic-method-call)
- website.spec.js: Anchor GitHub URL regex to prevent partial host
  matching (fixes js/regex/missing-regexp-anchor)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@raifdmueller raifdmueller merged commit 284498f into main Feb 20, 2026
6 checks passed
@raifdmueller raifdmueller deleted the fix/codeql-security-issues branch February 20, 2026 12:15
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