subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# Use printf which is safer than echo for arbitrary content cmd = f"printf '%s\\n' '{safe_pub_key}{safe_comment}' >> ~/.ssh/authorized_keys" subprocess.run( ['sshpass', '-e', 'ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null',- Confidence
- 84% confidence
- Finding
- subprocess.run( ['sshpass', '-e', 'ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-o', f'Port={port}',
