Skip to main content

CPython ftplib EUVDEUVD-2026-30177

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

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker operates or compromises source FTP server
  2. Delivery
    Victim application invokes ftpcp() with attacker-controlled source
  3. Exploit
    Source server returns PASV 227 reply with attacker-chosen internal IP:port
  4. Execution
    ftpcp() passes raw host to target.sendport() without validation
  5. Persist
    Target FTP server initiates data connection to attacker-specified internal host
  6. Impact
    Attacker achieves SSRF to internal services behind target's network boundary

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V4 - API and Web Service URL allowlisting, SSRF prevention
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Credential Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires three concurrent conditions: (1) the vulnerable application must use CPython's undocumented ftpcp() function from ftplib - standard FTP file operations via FTP.makepasv() or FTP.transfercmd() are not affected; (2) the FTP source server in the ftpcp() call must be attacker-controlled or attacker-compromised, so that PASV replies return an arbitrary host:port; (3) active user interaction (UI:A per CVSS) must trigger the ftpcp() invocation, such as a user-initiated backup, mirroring, or file-sync operation. Exploitation is limited by the rarity of ftpcp() usage in production code (it is explicitly undocumented), the requirement for attacker presence as the source FTP server, and the absence of confidentiality or availability impact - the attacker achieves only SSRF outbound connection establishment from the target FTP server, not code execution or data exfiltration. No default-configuration exploitation path exists because ftpcp() is never called implicitly by CPython itself.

Impact

The CVSS 4.0 score of 5.9 is driven primarily by network reachability (AV:N) and high integrity impact on the vulnerable system (VI:H), but is moderated by attack prerequisites (AT:P) and required active user interaction (UI:A), placing this well below critical severity. Confidentiality and availability impacts are both None (VC:N, VA:N), meaning a successful exploit cannot read data or disrupt service - it can only cause the target FTP server to initiate a connection to an attacker-specified host. EPSS at 0.04% (12th percentile) corroborates the SSVC assessment of exploitation:none and automatable:no, reflecting that ftpcp() is undocumented, rarely used in production code, and requires an attacker-controlled FTP source server in the data path. CISA KEV does not list this CVE. Taken together, these signals indicate low real-world priority for most organizations: the blast radius is narrow (only code invoking ftpcp() with untrusted FTP sources is affected), the impact class is SSRF rather than code execution, and there is no evidence of exploitation. The CVSS integrity:high rating may appear disproportionate relative to the actual impact - it reflects the ability to cause unauthorized outbound connections from the target server, not data modification of the target system's files.

Exploit ScenarioDerived

No public exploit has been identified at time of analysis. An attacker who controls or compromises an FTP source server (or operates a malicious FTP service that a developer connects to) crafts a PASV reply containing an internal address such as 192.168.1.1:8080; when a Python application calls ftpcp() to copy a file from this server, the target FTP server initiates a data connection to the attacker-specified internal host, achieving SSRF to services not externally reachable. The AT:P prerequisite reflects that this requires the attacker to be in the role of the source FTP server in the ftpcp() call chain.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 08, 2026

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.

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.

Affected VersionsENISA

CPython 0 <3.15.0

Affected Packages

euvd cpython fix: 3.15.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

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.

Know when Cpython gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

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
SUSE 5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Red Hat 5.3 HIGH

Primary rating from Vendor (PSF).

CVSS VectorVendor: PSF

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
High
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Social Media
2
Sightings
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment MSRC Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.

CVE-2026-17084 MEDIUM POC
6.0 Aug 18

Integrity bypass in CPython's stringprep module causes divergent domain name normalization when processing international

CVE-2026-115557 CRITICAL
9.4 Oct 24

CPython's ssl module validates TLS certificate chains that anchor to known-compromised eMudhra CA certificates, so anyon

CVE-2026-19445 CRITICAL
9.2 Sep 30

A use-after-free in CPython's ssl module lets a remote, unauthenticated TLS client crash a Python TLS server process - o

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-3298 HIGH
8.8 Apr 21

Out-of-bounds buffer write in CPython's asyncio.ProactorEventLoop (Windows only) allows remote attackers to trigger memo

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-19553 HIGH
7.6 Sep 30

Certificate hostname verification is silently skipped in CPython's TLS stack when an application enables SSLContext.chec

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-114583 MEDIUM
6.9 Oct 22

CPython's tarfile.tar_filter extraction filter can be bypassed with crafted link members, allowing a malicious tar archi

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

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