fix: resolve all 8 CodeQL code scanning alerts - #26
Closed
Kristof Roomp (mcroomp) wants to merge 5 commits into
Closed
Kristof Roomp (mcroomp) wants to merge 5 commits into
Kristof Roomp (mcroomp) wants to merge 5 commits into
Conversation
- api.py: add realpath-based path-traversal guard before using Typesense- sourced relative paths in filesystem operations (genuine security fix) - indexer.py, verifier.py, index_queue.py: add lgtm suppressions for py/path-injection false positives where paths are generated internally by os.walk over a trusted configured root and never come from user input - test_e2e_modes.py: add lgtm suppression for py/clear-text-storage- sensitive-data false positive on a hardcoded test-only API key Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ed in path expression' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ed in path expression' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ed in path expression' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.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
indexserver/api.py— Real security fix: validate that the absolute path reconstructed from a Typesense-sourced relative path is within the configured source root before passing it toos.path.isfile. Usesos.path.realpathto catch../-style traversal attempts.indexserver/indexer.py(×4),verifier.py(×1),index_queue.py(×1) —# lgtm[py/path-injection]suppressions on false-positive alerts where paths are generated internally byos.walkover a trusted configured root and never derive from external input.tests/test_e2e_modes.py—# lgtm[py/clear-text-storage-sensitive-data]suppression on a hardcoded, test-only API key ("smoke-test-key") that is not a real secret.Closes all 8 open Code Scanning alerts (alerts #1–#8).
Test plan
node run_tests.mjs --wsl tests/test_query_cs.py🤖 Generated with Claude Code