CVE-2021-4189

Executive Summary

Python's FTP client library in passive mode trusts the host and port returned by the server's PASV response. An attacker can run a malicious FTP server that returns a forged IP/port, causing the client to connect to arbitrary addresses. This allows the attacker to force the client to scan or connect to arbitrary network locations, potentially exposing sensitive data or facilitating further attacks. The flaw is client-side and does not require code execution on the server.


Authoritative CVE Metadata

  • CVSS Base Score: 5.3 (MEDIUM)
  • Last Modified: 10-11-26

Original Description

A flaw was found in Python, specifically in the FTP (File Transfer Protocol) client library in PASV (passive) mode. The issue is how the FTP client trusts the host from the PASV response by default. This flaw allows an attacker to set up a malicious FTP server that can trick FTP clients into connecting back to a given IP address and port. This vulnerability could lead to FTP client scanning ports, which otherwise would not have been possible.