subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
print('---FULLTEXT---') print(result['text']) """ result = subprocess.run( ["python", "-c", python_code], capture_output=True, text=True, encoding='utf-8', errors='replace' )- Confidence
- 98% confidence
- Finding
- The script builds Python source code with untrusted values interpolated into it and then executes it via `python -c`. A user-controlled `prompt` is inserted into a triple-quoted Python string without escaping, so crafted input can break out of the string and achieve arbitrary Python code execution in the spawned interpreter.
