subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_ssh_command(ssh_cmd: str, command: str) -> tuple[str, str, int]: """Execute command via SSH and return stdout, stderr, returncode.""" full_cmd = f"{ssh_cmd} '{command}'" result = subprocess.run( full_cmd, shell=True, capture_output=True, text=True ) return result.stdout, result.stderr, result.returncode- Confidence
- 98% confidence
- Finding
- result = subprocess.run( full_cmd, shell=True, capture_output=True, text=True )
