fix(security): resolve CodeQL SSRF, ReDoS, sensitive logging, and weak hashing alerts - #25
Merged
Merged
Conversation
…k hashing alerts - py/full-ssrf (#42): validate URL scheme, block restricted metadata hosts, and reconstruct safe endpoints with urlunsplit in litellm_service and settings router - py/polynomial-redos (#43, #44): optimize template literal regex and switch Next.js route path extraction to deterministic component splitting in api_route_extractor - js/incomplete-url-substring-sanitization (#95): parse hostname via new URL and verify domain boundaries in SearchInspector.tsx - py/clear-text-logging-sensitive-data (#1, #2, #3): sanitize logging in key_service by eliminating key prefix strings from log messages - py/weak-sensitive-data-hashing (#41): use PBKDF2-HMAC-SHA256 with salt for API key hashing in key_service - sync test counts in REQUIREMENTS.md
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
This PR addresses 8 standalone Critical and High severity CodeQL alerts identified across the repository:
py/full-ssrf(Alert #42 - Critical)http,https) and cloud metadata endpoint blocking (169.254.169.254,metadata.google.internal) inapp/services/litellm_service.pyandapp/api/routers/settings.py.urllib.parse.urlunsplit.tests/test_litellm_service.pyfor SSRF rejection.py/polynomial-redos(Alerts #43 & #44 - High)r'$\{([^{}]+)\}'inapp/services/chunking/api_route_extractor.py.js/incomplete-url-substring-sanitization(Alert #95 - High)new URL(u).hostnameand strictly checked domain boundaries infrontend/src/SearchInspector.tsx.py/clear-text-logging-sensitive-data(Alerts [Feature] AST-Based Call Graph Traversal & Relationship Tracing (trace_path MCP Tool) #1, [Feature] API Route Discovery & Cross-Service Endpoint Linking (find_routes & find_api_callers MCP Tools) #2, [Feature] Architecture Overview Synthesis & Architecture Decision Records (get_architecture & manage_adr MCP Tools) #3 - High)app/services/auth/key_service.py, keeping only non-sensitive identifiers (id,name,role).py/weak-sensitive-data-hashing(Alert #41 - High)app/services/auth/key_service.pyfrom unhardened SHA-256 to salted PBKDF2-HMAC-SHA256 (hashlib.pbkdf2_hmac).Verification