subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
temp_file.write(python_code) temp_file.close() process = subprocess.Popen( [sys.executable, temp_file.name], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,- Confidence
- 99% confidence
- Finding
- This code takes Python source from the JSON field `python_code`, writes it to a temporary file, and launches it with `subprocess.Popen` in detached mode. That is direct arbitrary code execution from untrusted input, and the detached/background execution with suppressed stdio makes the activity harder to observe and control while also bypassing the timeout protections used in the synchronous path.
