Skip to main content

CPython ftplib CVE-2026-8328

| EUVDEUVD-2026-30177 MEDIUM
Server-Side Request Forgery (SSRF) (CWE-918)
2026-05-13 PSF GHSA-j989-fggp-qgp5
5.9
CVSS 4.0 · Vendor: PSF
Share

Severity by source

Vendor (PSF) PRIMARY
5.9 MEDIUM
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
SUSE
5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Primary rating from Vendor (PSF).

CVSS VectorVendor: PSF

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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
A
Scope
X

Lifecycle Timeline

4
Source Code Evidence Fetched
Jun 08, 2026 - 11:05 vuln.today
Analysis Generated
Jun 08, 2026 - 11:05 vuln.today
CVSS changed
May 13, 2026 - 21:22 NVD
5.9 (MEDIUM)
CVE Published
May 13, 2026 - 20:14 nvd
UNKNOWN (no severity yet)

DescriptionCVE.org

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.

AnalysisAI

Server-Side Request Forgery in CPython's ftplib module allows a malicious FTP source server to redirect a target FTP server's data connection to an arbitrary internal host by supplying an attacker-controlled IP address and port in its PASV response. The ftpcp() function - used to copy files directly between two FTP servers - was inadvertently excluded from the CVE-2021-4189 fix that already hardened FTP.makepasv() against this class of SSRF. Affecting CPython versions prior to 3.15.0, no public exploit has been identified at time of analysis, and EPSS at 0.04% (12th percentile) signals low exploitation probability; the vulnerability is not listed in CISA KEV.

Technical ContextAI

The vulnerability resides in the undocumented ftpcp() helper in Lib/ftplib.py (cpe:2.3:a:python_software_foundation:cpython:*:*:*:*:*:*:*:*). FTP PASV mode has a well-documented SSRF primitive: the server's 227 reply includes a host:port pair that the client should use for the data connection. CVE-2021-4189 previously addressed this by patching FTP.makepasv() to discard the server-supplied IPv4 address and substitute the actual TCP peer address via getpeername()[0]. However, ftpcp() - which copies files directly between two FTP servers by having the target connect to the source's data socket - bypasses makepasv() entirely, calling parse227() directly and forwarding the untrusted PASV host to target.sendport(). CWE-918 (Server-Side Request Forgery) is the precise root cause: the application initiates a network connection to a destination supplied by an untrusted external party without validation, potentially reaching services that are not externally accessible. The GitHub diff at PR #149648 confirms the fix pattern: parse the PASV reply for the port only, and unconditionally substitute getpeername()[0] for the host unless the caller opts in via trust_server_pasv_ipv4_address.

RemediationAI

Upstream fix is available as GitHub PR #149648 (https://github.com/python/cpython/pull/149648); the released patched version targeting CPython 3.15.0 is not independently confirmed as a tagged release at time of analysis - monitor the PSF security announcement at https://mail.python.org/archives/list/security-announce@python.org/thread/ITF2BAPBQEPYK3LDMPRSY435JGNHYNDP/ for backport releases to supported branches (3.12, 3.13, 3.14). For immediate remediation, applications using ftpcp() should be audited and, where possible, replaced with a custom implementation that calls source.makepasv() (which already applies getpeername() substitution) rather than parse227() directly. If continued use of ftpcp() against trusted source servers is required, the trust_server_pasv_ipv4_address attribute can be set to True on the source FTP object - note this re-enables the vulnerable behavior and should only be used when the source server is fully trusted and not attacker-controllable. A network-level compensating control is to restrict outbound FTP data connections from target servers to a known allowlist of IP addresses, which would prevent SSRF redirection to arbitrary internal hosts at the cost of reduced FTP operational flexibility.

CVE-2026-6100 CRITICAL
9.1 Apr 13

CPython decompression modules (lzma, bz2, gzip) allow memory corruption via use-after-free when decompressor instances a

CVE-2026-11972 HIGH
8.2 Jun 23

Denial of service in CPython's tarfile module allows remote attackers to trigger an infinite loop by supplying a crafted

CVE-2026-9669 HIGH
8.2 Jun 08

Stack-based buffer overflow in CPython's bz2.BZ2Decompressor allows remote attackers to crash Python applications by sen

CVE-2026-11940 HIGH
7.8 Jun 23

Path traversal in CPython's tarfile module allows a crafted tar archive to bypass the 'data' and 'tar' extraction filter

CVE-2026-4786 HIGH
7.0 Apr 13

Command injection in CPython's webbrowser.open() API bypasses previous CVE-2026-4519 mitigation via specially crafted UR

CVE-2026-4519 HIGH
7.0 Mar 20

The webbrowser.open() API in CPython accepts URLs with leading dashes, which certain web browsers interpret as command-l

CVE-2026-7774 MEDIUM
6.9 Jun 04

Path traversal in CPython's tarfile module allows malicious tar archives to bypass the data_filter safety mechanism and

CVE-2026-7210 MEDIUM
6.3 May 11

XML parsers in CPython's xml.parsers.expat and xml.etree.ElementTree modules use insufficient entropy for Expat hash-flo

CVE-2026-3276 MEDIUM
6.3 Jun 03

Denial-of-service via quadratic algorithmic complexity in CPython's unicodedata.normalize() affects all CPython versions

CVE-2026-12003 MEDIUM
5.3 Jun 16

Privilege escalation in CPython on Windows enables a low-privileged local user to hijack the module search path of a mor

CVE-2026-0864 MEDIUM
4.1 Jun 23

Config file injection in CPython's configparser module allows an attacker who controls multi-line values written via con

CVE-2026-6019 LOW
2.1 Apr 22

CPython's http.cookies.Morsel.js_output() method generates inline script snippets that fail to neutralize the HTML parse

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SLES15-SP5-CHOST-BYOS-SAP-CCloud Fixed
SLES15-SP5-CHOST-BYOS-SAP-CCloud Fixed
SLES15-SP6-CHOST-BYOS Fixed
SLES15-SP6-CHOST-BYOS-Aliyun Fixed
SLES15-SP6-CHOST-BYOS-Azure Fixed

Share

CVE-2026-8328 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy