paramiko is the SSH / SFTP client for Python. SSHClient.set_missing_host_key_policy with AutoAddPolicy() silently trusts unknown hosts — MITM risk. exec_command() is a command-execution sink when the command is user-controlled.
.set_missing_host_key_policy().connect().exec_command().set_missing_host_key_policy()SinkSSHClient.set_missing_host_key_policy(policy: MissingHostKeyPolicy)
Sets host-key policy. Finding when policy is AutoAddPolicy() or WarningPolicy() (MITM).
0.connect()SinkSSHClient.connect(hostname, port=22, username=None, password=None, ...) -> None
Connects to an SSH server. SSRF-like sink when hostname is user-controlled.
0.exec_command()SinkSSHClient.exec_command(command: str, bufsize=-1, ...) -> (stdin, stdout, stderr)
Runs a command on the remote host. Command-injection sink on user-controlled command.
0| FQN | Field | |
|---|---|---|
| paramiko | fqns[0] | |
| paramiko.SSHClient | fqns[1] |
Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.
from codepathfinder.go_rule import PyParamiko