subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
command, ] try: result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout, input=stdin) return result.returncode, result.stdout, result.stderr except subprocess.TimeoutExpired: return -1, "", "SSH connection timed out"- Confidence
- 96% confidence
- Finding
- This subprocess call executes SSH with a remote shell command string built from user-controlled inputs such as host, path, mode, and search name. Although shell=False prevents local shell injection, the remote side still interprets the command via a shell, and the custom escaping is incomplete in places, enabling command injection or unintended command execution on the remote host.
