subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
temp_path = f.name try: result = subprocess.run( ['python3', temp_path], capture_output=True, text=True,- Confidence
- 98% confidence
- Finding
- This subprocess call executes Python code that was produced by an LLM after being written to a temporary file. Although shell injection is not present because arguments are passed as a list, it is still dangerous because the executed code runs with the current user's normal OS privileges, enabling file access, network calls, and arbitrary command execution via Python libraries.
