subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
env = os.environ.copy() env["MINIMAX_API_KEY"] = api_key result = subprocess.run(cmd, capture_output=True, text=True, timeout=60, env=env) if result.returncode == 0: try:- Confidence
- 92% confidence
- Finding
- The code launches an external program using subprocess and passes user-influenced prompt content to it. Although it avoids shell=True and argument injection is limited, this still creates an execution and data-egress capability outside the stated local confidence-checking role, increasing attack surface and dependency on an external binary.
