subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: # Run in subprocess with timeout and no network result = subprocess.run( ["python3", "-c", safe_code], capture_output=True, text=True, timeout=SANDBOX_TIMEOUT,- Confidence
- 98% confidence
- Finding
- This subprocess invocation executes attacker-controlled Python via `python3 -c` after only brittle substring filtering. Because the process runs as a normal local Python interpreter without OS-level sandboxing, a determined prompt or code payload can bypass the blocklist and achieve local file access, command execution, or other side effects despite the comments claiming 'no network' and 'no file writes'.
