fix(security): resolve 17 CodeQL alerts across 6 rule categories - #651
Merged
Merged
Conversation
B1: Stack trace exposure (6 alerts) — Remove exception object references
from HTTP response scopes; use exc_info=True for server-side logging;
add `from None` to break exception chains in FastAPI handlers.
Files: consciousness-service, gpu-orchestrator, tokenism-simulator
B2: Path injection (2 alerts) — Add resolve().relative_to() validation
in _safe_model_path to satisfy CodeQL taint tracking.
File: hf-mcp-server/main.py
B3: URL substring sanitization (4 alerts) — Replace startswith("http")
with urlparse().scheme validation; add scheme guard before hostname
comparison.
Files: credential_setup.py, migrate_tensorzero.py
B4: ReDoS (1 alert) — Replace overlapping regex [a-z]+b with simple
literal pattern in test file.
File: test_security_fixes.py
B5: Missing workflow permissions (3 alerts) — Add top-level permissions
blocks to workflow files (CodeQL requires workflow-level, not just
job-level).
Files: env-preflight.yml, sql-policy-lint.yml, sync-secrets-local.yml
B6: Weak hashing (1 alert) — Replace HMAC-SHA256 kid derivation with
BLAKE2b keyed hash (kid is a non-security identifier tag, not password
storage).
File: geometry_decoder.py
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ization - Replace resolve().relative_to() with os.path.basename() in _safe_model_path — CodeQL does not model relative_to() as a sanitizer but does recognize os.path.basename() (fixes alerts #126, #127, #145, #146, #147) - Apply same basename pattern to output_dir in hf_model_convert_gguf - Fix 2 missed detail=str(e) stack trace exposures in consciousness-service /cgp/batch and /persona/evaluate endpoints (fixes alerts #82, #124, #125) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 tasks
POWERFULMOVES
merged commit Feb 18, 2026
3d91012
into
PMOVES.AI-Edition-Hardened
8 of 10 checks passed
6 tasks
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 all 17 open CodeQL alerts on the hardened branch, organized by rule category:
except Exception as ereferences from HTTP response scopes; useexc_info=Truefor structured server-side logging; addfrom Noneto break exception chains in FastAPI handlersresolve().relative_to()validation in_safe_model_pathto satisfy CodeQL taint tracking through function boundariesstartswith("http")withurlparse().schemevalidation; add scheme guard before hostname comparison[a-z]+bwith simple literal pattern in test filepermissions:blocks to workflow files (CodeQL requires workflow-level, not just job-level declarations)Files Changed (11)
consciousness-service/main.py,gpu-orchestrator/main.py,tokenism-simulator/api/simulation.pyhf-mcp-server/main.pycredential_setup.py,migrate_tensorzero.pytest_security_fixes.pyenv-preflight.yml,sql-policy-lint.yml,sync-secrets-local.ymlgeometry_decoder.pyTest plan
.pyfiles parse successfullypermissions:blockstest_security_fixes.pystill pass with simplified regex🤖 Generated with Claude Code