fix(security): resolve final 24 CodeQL alerts for path injection and stack trace exposure - #28
Merged
Merged
Conversation
…stack trace exposure - Sanitize exception responses and rate limit errors in git_manager, vector_store manager, and vector store adapters (chroma, qdrant, pgvector). - Enforce canonical root-prefix and commonpath sanitization before file system operations across file_reader, summarizer, repositories router, and vector stores. - Update unit tests to verify error handling without expecting exposed internal exceptions.
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
Remediates the final 24 open CodeQL security alerts:
py/stack-trace-exposure(6 alerts):app/services/git_manager.py(rate limit check).app/services/vector_store/manager.py(get_vector_store_config,switch_vector_store,test_connection).health_checkimplementations.py/path-injection(18 alerts):app/api/routers/repositories.py: Addedstartswithandcommonpathroot containment validations beforeos.path.existsandos.scandirinapi_add_pathandapi_browse_dir.app/api/routers/settings.py: Added path validation onstorage_pathinapi_test_vector_storeandapi_switch_vector_store.app/services/file_reader.py: Relocated root prefix checks prior toos.path.lexistscalls and added barrier checks inis_binary_fileandread_file.app/services/summarizer.py: Added root prefix validation before fallback disk file reads.app/services/vector_store/chroma_store.py&qdrant_store.py: Added root validation beforeos.makedirson embedded storage paths.Verification