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
    • 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-2024-3219

CVE-2024-3219: Python socket Module Race Condition Flaw

CVE-2024-3219 is a race condition vulnerability in Python's socket module affecting Windows systems. The flaw allows malicious local peers to intercept socket connections. This article covers technical details, affected versions, impact, and mitigation strategies.

Updated: January 22, 2026

CVE-2024-3219 Overview

CVE-2024-3219 is a race condition vulnerability in Python's socket module that affects the pure-Python fallback implementation of socket.socketpair() on platforms lacking AF_UNIX support, primarily Windows. The vulnerability allows a malicious local peer to exploit a connection race condition during socket pair creation, potentially enabling unauthorized access to socket communications.

The socket.socketpair() function provides a pure-Python fallback for platforms that don't support AF_UNIX sockets. This fallback uses AF_INET or AF_INET6 to create a local connected pair of sockets. However, the connection between the two sockets was not verified before being returned to the user, leaving the server socket vulnerable to connection hijacking from a malicious local process.

Critical Impact

Local attackers on Windows systems can exploit a connection race condition to intercept or inject data into socket pairs created by Python applications, potentially compromising inter-process communications.

Affected Products

  • CPython 3.5 and later versions on Windows
  • CPython 3.5 and later versions on other platforms without AF_UNIX support
  • Python applications using socket.socketpair() on affected platforms

Discovery Timeline

  • July 29, 2024 - CVE-2024-3219 published to NVD
  • May 2, 2025 - Last updated in NVD database

Technical Details for CVE-2024-3219

Vulnerability Analysis

This vulnerability falls under CWE-306 (Missing Authentication for Critical Function). The root cause is the lack of connection verification in the socket.socketpair() fallback implementation. When socket.socketpair() is called on Windows, the pure-Python fallback creates a listening socket, accepts a connection, and returns the socket pair without validating that the connection actually came from the intended client socket.

The vulnerable window exists between when the client socket initiates a connection and when the server accepts it. During this brief period, a malicious local process could race to connect to the listening socket first, effectively hijacking the socket pair. This is particularly concerning for applications that rely on socket.socketpair() for secure inter-process communication, as the assumption of a trusted connection is violated.

Platforms that support AF_UNIX such as Linux and macOS are not affected by this vulnerability because they use native AF_UNIX sockets for socketpair(). Additionally, versions prior to CPython 3.5 are not affected because the vulnerable API was not included in those versions.

Root Cause

The vulnerability stems from missing authentication in the socket.socketpair() fallback implementation. The original code did not verify that the accepted connection on the server socket actually originated from the corresponding client socket created in the same function call. This created a Time-of-Check Time-of-Use (TOCTOU) race condition where an attacker could substitute their own connection.

Attack Vector

The attack requires local access to the target system. An attacker must be able to:

  1. Monitor for socket.socketpair() calls on the local system
  2. Predict or discover the ephemeral port used by the listening socket
  3. Race to establish a connection before the legitimate client socket connects

The fix implements proper socket authentication by verifying that the peer addresses match between the socket pair:

python
# Authenticating avoids using a connection from something else
# able to connect to {host}:{port} instead of us.
# We expect only AF_INET and AF_INET6 families.
try:
    if (
        ssock.getsockname() != csock.getpeername()
        or csock.getsockname() != ssock.getpeername()
    ):
        raise ConnectionError("Unexpected peer connection")
except:
    # getsockname() and getpeername() can fail
    # if either socket isn't connected.
    ssock.close()
    csock.close()
    raise

Source: GitHub CPython Commit #06fa244

Detection Methods for CVE-2024-3219

Indicators of Compromise

  • Unexpected connections to ephemeral ports used by Python applications on Windows
  • Anomalous local network activity during Python application startup or socket pair creation
  • Failed socket operations with "Unexpected peer connection" errors after patching

Detection Strategies

  • Monitor Python applications for usage of socket.socketpair() on Windows systems
  • Implement network monitoring for unusual local loopback traffic patterns
  • Review application logs for socket-related errors or connection anomalies
  • Use SentinelOne's behavioral detection to identify suspicious local network activity

Monitoring Recommendations

  • Enable enhanced logging for Python applications using socket communications on Windows
  • Monitor for multiple rapid connection attempts to local ephemeral ports
  • Audit Python version inventories across Windows systems to identify unpatched installations
  • Implement process monitoring to detect unusual inter-process communication patterns

How to Mitigate CVE-2024-3219

Immediate Actions Required

  • Update Python to the latest patched version for your major release (3.9.x, 3.10.x, 3.11.x, 3.12.x, or 3.13.x)
  • Audit applications using socket.socketpair() on Windows for potential exposure
  • Consider implementing additional application-level authentication for socket communications
  • Review and update Python installations across all Windows environments

Patch Information

The Python Security Team has released patches across multiple supported branches. The fix adds connection authentication by verifying that ssock.getsockname() matches csock.getpeername() and vice versa before returning the socket pair.

Patches are available in the following commits:

  • Python 3.9: Commit 06fa244
  • Python 3.10: Commit 0b65c8b
  • Python 3.12: Commit 220e31a

For complete details, refer to the Python Security Announcement and GitHub Issue #122133.

Workarounds

  • Where possible, use AF_UNIX sockets directly instead of relying on socket.socketpair() fallback
  • Implement application-level authentication for socket pair communications as an additional layer
  • Consider using alternative IPC mechanisms on Windows that don't rely on TCP sockets
  • Restrict local user access on Windows systems running sensitive Python applications
bash
# Check Python version for vulnerability assessment
python --version

# Update Python using pyenv (if applicable)
pyenv install 3.12.5
pyenv global 3.12.5

# Or update using system package manager on Windows
# Download latest installer from python.org

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

  • Vulnerability Details
  • TypeRace Condition

  • Vendor/TechPython

  • SeverityMEDIUM

  • CVSS Score5.1

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/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
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-306
  • Technical References
  • Openwall Mailing List Post

  • GitHub CPython Commit #06fa244

  • GitHub CPython Commit #0b65c8b

  • GitHub CPython Commit #220e31a

  • GitHub CPython Commit #2621a8a

  • GitHub CPython Commit #31302f5

  • GitHub CPython Commit #3f5d9d1

  • GitHub CPython Commit #5df322e

  • GitHub CPython Commit #5f90abaa

  • GitHub CPython Commit #78df104

  • GitHub CPython Commit #b252317

  • GitHub CPython Commit #c21a361

  • GitHub CPython Commit #c5655aa

  • GitHub CPython Commit #e319f77

  • GitHub CPython Commit #f071f01

  • GitHub Issue #122133

  • GitHub Pull Request #122134

  • Python Security Announcement Archive

  • NetApp Security Advisory NTAP-20250502-0004
  • Related CVEs
  • CVE-2024-0397: Python SSL Module Race Condition Flaw

  • CVE-2025-13462: Python tarfile Module Parsing Vulnerability

  • CVE-2026-2297: CPython Information Disclosure Vulnerability

  • CVE-2025-13836: Python Python DOS Vulnerability
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