subprocess module call
- Category
- Dangerous Code Execution
- Confidence
- 70% confidence
- Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
- Content
python def run_cmd(cmd: List[str], input_data: Optional[bytes] = None, timeout: float = 10.0) -> tuple[int, str, str]: """Run a command and return (returncode, stdout, stderr).""" try: result = subprocess.run( cmd, input=input_data, capture_output=True,
