A connection is opened with FTP or Telnet, which encrypt nothing
What it finds
ftplib.FTP(host), telnetlib.Telnet(host): FTP and Telnet send passwords and data unencrypted, so anyone on the network path can read and change them (CWE-319). ftplib.FTP_TLS, SFTP or SSH encrypt the connection.
From the rule's source, unencrypted_connection.rs.
import ftplibfrom telnetlib import Telnet def connect(host): a = ftplib.FTP(host)tx0 reports: ftplib.FTP sends everything, passwords included, unencrypted b = Telnet(host)tx0 reports: telnetlib.Telnet sends c = ftplib.FTP_TLS(host) return a, b, c Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/python:unencrypted-connection" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
# tx0: ignore[tx0/python:unencrypted-connection] reason="..."tx0 explain tx0/python:unencrypted-connection shows the same in the terminal. Found a false positive? Report it.