The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-8328

CVE-2026-8328: Python ftplib.py CSRF Vulnerability

CVE-2026-8328 is a CSRF flaw in Python's ftplib.py where ftpcp() passes attacker-controlled IP addresses to target.sendport(). This post covers the technical details, affected versions, and mitigations.

Published: May 14, 2026

CVE-2026-8328 Overview

CVE-2026-8328 is a Server-Side Request Forgery (SSRF) vulnerability in the Python standard library ftplib module. The ftpcp() function in Lib/ftplib.py was not updated when CVE-2021-4189 was remediated. While makepasv() was patched to replace server-supplied PASV host addresses with the actual peer address from getpeername()[0], ftpcp() still calls parse227() directly. The function passes the raw attacker-controllable IP address and port to target.sendport(), enabling redirection of FTP data connections to arbitrary hosts. The flaw is categorized under CWE-918.

Critical Impact

A malicious FTP server can coerce a Python client using ftpcp() to initiate data transfers to attacker-chosen internal or external hosts, enabling SSRF against internal services.

Affected Products

  • Python CPython Lib/ftplib.py — ftpcp() function
  • Applications and scripts that invoke ftplib.FTP.ftpcp() for server-to-server FTP copy
  • Python distributions that did not extend the CVE-2021-4189 fix to ftpcp()

Discovery Timeline

  • 2026-05-13 - CVE-2026-8328 published to NVD
  • 2026-05-13 - Last updated in NVD database

Technical Details for CVE-2026-8328

Vulnerability Analysis

The Python ftplib module supports server-to-server file copy via the ftpcp() helper. This routine opens a passive data connection on one FTP server and instructs a second server to connect to it using the PORT command. The original CVE-2021-4189 patch hardened makepasv() to discard attacker-supplied addresses returned in 227 responses, substituting the actual TCP peer address. The same hardening was never applied to ftpcp(). As a result, a hostile source FTP server can return a crafted 227 reply containing an arbitrary IP address and port, which ftpcp() forwards verbatim to the destination server through sendport().

Root Cause

The root cause is incomplete remediation of CVE-2021-4189. ftpcp() invokes parse227() on the source server response and uses the resulting tuple without validation. Because the value is never reconciled against the established socket's peer address, the trust boundary between the FTP control channel and the data channel target is broken.

Attack Vector

Exploitation requires a victim to initiate an FTP copy via ftpcp() against a malicious source server, satisfying the User Interaction (UI:A) requirement in the CVSS vector. The malicious server responds to a PASV request with a 227 reply pointing at an internal host, such as a metadata service or internal management interface. The victim's Python process then directs the destination FTP server to open a data connection to that target. This produces an SSRF primitive that can reach hosts otherwise unreachable from the attacker. The vulnerability impacts integrity (VI:H) by allowing arbitrary data to be pushed to non-FTP services that tolerate FTP banner traffic. Technical details are documented in GitHub Issue #87451 and Pull Request #149648.

Detection Methods for CVE-2026-8328

Indicators of Compromise

  • Outbound FTP PORT commands issued by Python processes that reference internal RFC1918 addresses or cloud metadata IPs such as 169.254.169.254.
  • 227 PASV responses from external FTP servers containing host octets that do not match the established TCP peer address.
  • Unexpected TCP connections from FTP servers to internal services on non-FTP ports.

Detection Strategies

  • Inspect FTP control traffic at egress points and alert when 227 response addresses diverge from the connected server IP.
  • Audit Python applications for calls to ftplib.FTP.ftpcp() and instrument them to log parsed PASV tuples.
  • Correlate process telemetry showing python executing ftplib with outbound connections to sensitive internal CIDRs.

Monitoring Recommendations

  • Enable network flow logging on hosts that perform automated FTP transfers and baseline expected destinations.
  • Monitor cloud metadata endpoints for anomalous source processes, especially Python interpreters.
  • Capture and review FTP PORT/EPRT commands forwarded to destination servers for non-routable or sensitive targets.

How to Mitigate CVE-2026-8328

Immediate Actions Required

  • Inventory all uses of ftplib.FTP.ftpcp() across internal codebases and CI pipelines.
  • Restrict outbound FTP traffic from application hosts to known, trusted FTP endpoints only.
  • Apply the upstream CPython patch from Pull Request #149648 once released in your Python version stream.

Patch Information

The fix extends the CVE-2021-4189 mitigation to ftpcp() by validating that the address returned by parse227() matches the FTP control connection's peer address before passing it to sendport(). Track distribution-specific Python package updates and the Python Security Announcement Thread for backport availability.

Workarounds

  • Avoid ftpcp() and implement server-to-server copy logic that explicitly validates the PASV host against the source server's peer address.
  • Wrap ftpcp() calls with a custom override of parse227() that discards the supplied IP and substitutes self.sock.getpeername()[0].
  • Use SFTP or HTTPS-based file transfer protocols for untrusted source servers, eliminating the FTP data channel trust issue entirely.
bash
# Egress firewall example: restrict Python FTP clients to a known server allowlist
iptables -A OUTPUT -m owner --uid-owner appuser -p tcp --dport 21 -d 203.0.113.10 -j ACCEPT
iptables -A OUTPUT -m owner --uid-owner appuser -p tcp --dport 21 -j REJECT
# Block access to cloud metadata from application host
iptables -A OUTPUT -d 169.254.169.254 -j REJECT

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeCSRF

  • Vendor/TechPython

  • SeverityMEDIUM

  • CVSS Score5.9

  • Known ExploitedNo
  • CVSS 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/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
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityNone
  • CWE References
  • CWE-918
  • Technical References
  • GitHub Issue #87451

  • GitHub Pull Request #149648

  • Python Security Announcement Thread
  • Related CVEs
  • CVE-2026-5713: Python Privilege Escalation Vulnerability

  • CVE-2024-3219: Python Socket Module Race Condition Flaw

  • CVE-2025-5302: LlamaIndex JSONReader DoS Vulnerability

  • CVE-2026-6100: Python Decompressor Use-After-Free Flaw
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English