Repository navigation
fix(security): resolve CodeQL code scanning alerts - #9
Merged
Merged
Conversation
- 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>
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
Resolves the five open CodeQL code scanning alerts on
main:server.py:1293py/path-injectionos.path.realpathand validate the result with astartswithguard before any filesystem accessdaemon.py:295py/clear-text-logging-sensitive-dataapp.jsjs/client-side-unvalidated-url-redirectionnavigate()→goToPage(); CodeQL modelswindow.navigate(...)as a redirect sinkThe 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 passnode scripts/check-web.jsandnode --check src/lsec/web/app.jspass/,/assets/app.js,/assets/style.css, traversal and missing-file paths🤖 Generated with Claude Code