-
-
Notifications
You must be signed in to change notification settings - Fork 1
Security: Address remaining CodeQL alert gaps from #3164 implementation #3205
Copy link
Copy link
Open
Description
Context
During implementation of #3164 (PRs #3182, #3183, #3204), several gaps and behavioral changes were discovered that need follow-up.
Remaining CodeQL alerts (not addressed)
1. py/clear-text-storage-sensitive-data (~5 alerts)
autobot-backend/services/trigger_service.py:896— stores HMAC webhook secrets in Redis as plain text viaredis.setex()autobot-backend/api/secrets.py:351— writes secrets to JSON files viajson.dump()without encryption- Fix: Encrypt secrets at rest using Fernet/AES before storing in Redis and on disk
2. py/clear-text-logging-sensitive-data (~55 alerts)
- CodeQL flags log lines containing variable names like
token,password,secretacross ~35 files - All are false positives — they log metadata (IDs, names, error messages), not actual secret values
- Fix: Add
# codeql-suppress py/clear-text-logging-sensitive-datainline comments with explanations to suppress false positives and reduce alert noise
3. py/insecure-protocol (~4 alerts)
- All
http://URLs are for internal service-to-service communication (Ollama, NPU worker, ChromaDB, backend health checks) - Internal HTTP on private networks is intentional design
- Fix: Add
# codeql-suppress py/insecure-protocolcomments, or make scheme configurable via ssot_config (e.g.,config.get_scheme('ollama'))
4. py/command-line-injection (~3 alerts)
elevation_wrapper.py:154—create_subprocess_shell(command)— intentional command executionutils/terminal_websocket_manager.py:223—subprocess.Popen— terminal emulatorintelligence/streaming_executor.py:412—create_subprocess_exec(*cmd_parts)— AI executor- Fix: These are by design. Add suppression comments documenting the authorization model.
Behavioral changes from PRs that need verification
5. Auth token sessionStorage migration (PR #3183)
- Moved SLM frontend auth tokens from
localStoragetosessionStorage - Impact: Users must re-login after closing browser tabs
- Gap:
LoginView.vueandSSOCallbackView.vuewrite tosessionStoragebut some code paths may still read fromlocalStorageonly - Verify: Grep for all
localStorage.getItem('slm_access_token')and ensure they fall back tosessionStorage
6. Analytics slug regex relaxation (PR #3204)
- Removed lookaheads
(?=.*[a-z])(?=.*\d)fromanalytics_controller.pyslug detection to fix ReDoS - Impact: Regex now matches pure-alpha or pure-numeric slugs ≥8 chars (e.g.,
abcdefgh,12345678) that were previously excluded - Verify: Check if this causes false positives in analytics URL normalization
Discovered during
Reactions are currently unavailable