CVE-2026-8328

FTP PASV SSRF, ftpcp() does not use actual peer address, trusts server-supplied PASV host address

Published May 13, 2026 CVSS 4.0 · 5.9 Medium EPSS < 1% KEV · Not listed
Description
The ftpcp() function in Lib/ftplib.py was not updated when
CVE-2021-4189 was fixed. While makepasv() was patched to replace
server-supplied PASV host addresses with the actual peer address
(getpeername()[0]), ftpcp() still calls parse227() directly and passes
the raw attacker-controllable IP address and port to target.sendport(). This patch is related to CVE-2021-4189.

Analysis

AI-generated

Technical impact

The ftpcp() routine in Python’s ftplib module accepts the host address provided in a server‑generated PASV response and uses it to open the data connection. Because the function does not verify that the address matches the control‑channel peer, an attacker who controls the FTP server can supply any IP and port in the PASV reply, leading the client to establish a TCP connection to that address. This behavior can expose internal services or allow the client to reach otherwise inaccessible networks, and it is classified as CWE‑918. It is inferred that the attacker must control the FTP server to supply a malicious PASV response.

Affected Systems

Any CPython installation that ships the unpatched ftplib module is potentially vulnerable. The advisory references the CPython project and its community pull request that introduced the fix, but no specific released version numbers are listed because the patch had yet to be merged into a released distribution at the time of the advisory.

Risk and Exploitability

The CVSS score of 5.9 denotes moderate severity. Exploitation requires a client to connect to an attacker‑controlled FTP server that sends a crafted PASV reply; no client‑side privileges or special network conditions are necessary. The EPSS score is unavailable, and the vulnerability is not listed in the CISA KEV catalog, suggesting limited widespread exploitation. The likely attack vector involves an attacker hosting a malicious FTP server, connecting to the vulnerable Python client, and issuing a PASV response with a chosen IP and port so that the client initiates a connection to the attacker‑controlled destination.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to a CPython distribution that includes the ftpcp patch (for example, Python releases issued after the community pull request was merged).
  • If an immediate upgrade is not possible, apply the community patch (PR 149648) that replaces the call to parse227() with a retrieval of the actual peer address via getpeername()[0] so that the data‑connection host is validated.
  • As a temporary measure, reconfigure ftplib to use active mode or wrap ftpcp() so that the PASV host field is ignored, preventing the client from connecting to attacker‑specified addresses.
  • Deploy outbound firewall rules or host‑based filtering to restrict connections initiated by the FTP client to only known trusted networks, blocking attempts to reach private or otherwise sensitive IP ranges.

Generated by OpenCVE AI on May 13, 2026 at 22:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4827-1 python3.11 security update
Ubuntu USN Ubuntu USN USN-8509-1 Python vulnerabilities
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Python
Python cpython
Vendors & Products Python
Python cpython
Type Values Removed Values Added
Description The ftpcp() function in Lib/ftplib.py was not updated when CVE-2021-4189 was fixed. While makepasv() was patched to replace server-supplied PASV host addresses with the actual peer address (getpeername()[0]), ftpcp() still calls parse227() directly and passes the raw attacker-controllable IP address and port to target.sendport(). This patch is related to CVE-2021-4189.
Title FTP PASV SSRF, ftpcp() does not use actual peer address, trusts server-supplied PASV host address
Weaknesses CWE-918
References
Metrics cvssV4_0

{'score': 5.9, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-918

    Server-Side Request Forgery (SSRF)

Sources

Status
PUBLISHED
Assigner
PSF
Published
Updated
Nov 10, 2026, 12:40 PM
Reserved
May 11, 2026, 3:06 PM
Status
Awaiting Analysis
Published
May 13, 2026, 9:16 PM
Modified
Nov 10, 2026, 1:19 PM