subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
return True try: log(f" Auto-distilling session {session_id[:8]}...") result = subprocess.run( ["python3", str(DISTILL_SCRIPT), "--live-session", session_id], capture_output=True, text=True,- Confidence
- 82% confidence
- Finding
- The code passes session_id obtained from gateway output directly into a secondary script that performs live distillation. Although shell injection is avoided, this still creates a trust boundary issue: untrusted session metadata from the gateway can trigger processing of arbitrary session IDs, potentially causing unintended access to or processing of other session files if distill.py does not strictly validate identifiers.
