subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
e = os.environ.copy() if env: e.update(env) r = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=timeout, env=e) return r.returncode, r.stdout.strip(), r.stderr.strip()- Confidence
- 93% confidence
- Finding
- The helper executes shell commands with shell=True, which is inherently dangerous because any future use with variable or attacker-influenced input can lead to command injection. In this file the current call sites use fixed strings, so exploitation is not immediate, but the primitive is unsafe and unnecessary in a deployment script that starts services and handles tokens.
