Skip to content

fix(security): resolve CodeQL code scanning alerts - #9

Merged
UnmetDecade merged 1 commit into
mainfrom
fix/codeql-alerts
Nov 16, 2026
Merged

UnmetDecade merged 1 commit into
mainfrom
fix/codeql-alerts

Conversation

@UnmetDecade

Copy link
Copy Markdown
Owner

Summary

Resolves the five open CodeQL code scanning alerts on main:

Alert Rule Fix
#5 server.py:1293 py/path-injection Normalize with os.path.realpath and validate the result with a startswith guard before any filesystem access
#4 daemon.py:295 py/clear-text-logging-sensitive-data Log the data directory instead of the secrets directory path
#1–#3 app.js js/client-side-unvalidated-url-redirection Rename the SPA router navigate() → goToPage(); CodeQL models window.navigate(...) as a redirect sink

The static file handler's behavior is unchanged: valid assets still serve, path traversal (/assets/../daemon.py, /assets/%2e%2e/...) and unknown files return 404.

Test plan

  • PYTHONPATH=src python3 -m unittest discover -s tests -t . — 160 tests pass
  • node scripts/check-web.js and node --check src/lsec/web/app.js pass
  • Manual check of /, /assets/app.js, /assets/style.css, traversal and missing-file paths
  • CodeQL re-scan on this PR reports no alerts

🤖 Generated with Claude Code

- serve_static: normalize the requested path with os.path.realpath and
  verify it stays under the UI directory via a startswith guard before
  any filesystem access (py/path-injection).
- daemon: log only the data directory instead of the secrets directory
  path (py/clear-text-logging-sensitive-data).
- web: rename the SPA router from navigate() to goToPage() so CodeQL no
  longer matches it against the window.navigate redirect sink
  (js/client-side-unvalidated-url-redirection).

Co-Authored-By: Claude Code <noreply@anthropic.com>
@UnmetDecade
UnmetDecade merged commit 37c1dbc into main Nov 16, 2026
9 checks passed
@UnmetDecade
UnmetDecade deleted the fix/codeql-alerts branch November 16, 2026 02:07
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