banner logoJoin us at RSAC™ 2026 Conference, March 23–March 26 | North Expo, Booth N-5863Join us at RSAC™ 2026, March 23–March 26Learn More
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI Security Portfolio
      Leading the Way in AI-Powered Security Solutions
    • 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
      Digital Forensics, IRR & Breach Readiness
    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
    • 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-2023-40217

CVE-2023-40217: Python TLS Information Disclosure Flaw

CVE-2023-40217 is an information disclosure vulnerability in Python's TLS implementation affecting servers using client authentication. Unauthenticated data may be read from socket buffers. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: February 11, 2026

CVE-2023-40217 Overview

A TLS client authentication bypass vulnerability has been discovered in Python that affects servers using TLS client authentication, such as HTTP servers. The vulnerability exists in Python's SSLSocket implementation where a race condition allows unauthenticated data to be read from the socket buffer when a TLS server-side socket is created, receives data, and is closed quickly. During this brief window, the SSLSocket instance detects the socket as "not connected" and fails to initiate a proper TLS handshake, yet buffered data remains readable and is indistinguishable from valid TLS stream data.

Critical Impact

Servers relying on TLS client certificate authentication may process unauthenticated data as if it were from an authenticated client, potentially bypassing security controls designed to restrict access to authorized users only.

Affected Products

  • Python versions before 3.8.18
  • Python versions 3.9.x before 3.9.18
  • Python versions 3.10.x before 3.10.13
  • Python versions 3.11.x before 3.11.5

Discovery Timeline

  • August 25, 2023 - CVE CVE-2023-40217 published to NVD
  • November 3, 2025 - Last updated in NVD database

Technical Details for CVE-2023-40217

Vulnerability Analysis

This vulnerability represents an SSL/TLS vulnerability in Python's socket handling that can lead to an authentication bypass. The issue primarily impacts server applications that implement TLS client certificate authentication as a security mechanism. When a TLS server-side socket is created and receives data into its buffer before being quickly closed, a timing condition occurs where the SSLSocket instance incorrectly determines the socket is "not connected."

Under normal circumstances, the TLS handshake process would authenticate the client before any application data is processed. However, this vulnerability creates a scenario where the handshake is never initiated, yet data that was buffered during socket initialization remains accessible. This buffered data bypasses the intended client certificate authentication mechanism entirely.

The data exposure is limited to the amount that fits within the socket buffer, and notably, the vulnerability cannot be exploited for direct data exfiltration because the vulnerable code path requires the connection to be closed during SSLSocket initialization.

Root Cause

The root cause lies in Python's SSLSocket implementation logic for handling connection state detection. When a socket is rapidly closed after creation but before the TLS handshake completes, the SSLSocket's connection state detection mechanism incorrectly identifies the socket as disconnected. This causes the handshake process to be skipped entirely, while any data already present in the socket buffer remains readable through normal read operations. The improper handling of this edge case during socket initialization creates the authentication bypass condition.

Attack Vector

An attacker can exploit this vulnerability by establishing a TCP connection to a vulnerable Python TLS server and sending data to the socket buffer before quickly closing the connection. The attack targets the brief window between socket creation and the expected TLS handshake initiation. The attacker's unauthenticated data in the buffer may then be processed by the server as if it were legitimate, authenticated TLS traffic.

The network-based attack vector requires no privileges and no user interaction. The attacker must have network access to the target TLS server and be able to time their connection and disconnection to exploit the race condition. This primarily affects servers that rely on TLS client certificate authentication for access control decisions.

Detection Methods for CVE-2023-40217

Indicators of Compromise

  • Unusual connection patterns showing rapid TCP connect/disconnect cycles to TLS-enabled services
  • Server log entries indicating processed requests without corresponding completed TLS handshakes
  • Client certificate authentication logs showing successful data processing without valid certificate verification
  • Anomalous short-lived connections to services requiring mutual TLS authentication

Detection Strategies

  • Monitor TLS server applications for connections that process data without completing the TLS handshake sequence
  • Implement logging at the application layer to correlate processed requests with successful certificate authentication events
  • Deploy network monitoring to identify rapid connection establishment and teardown patterns targeting TLS services
  • Audit Python application dependencies to identify vulnerable versions in production environments

Monitoring Recommendations

  • Enable detailed SSL/TLS logging in Python applications to capture handshake state information
  • Configure intrusion detection systems to alert on connection timing anomalies to critical TLS-authenticated services
  • Implement application-level monitoring to verify client certificate validation occurs before processing requests
  • Regularly scan infrastructure for Python installations matching affected version ranges

How to Mitigate CVE-2023-40217

Immediate Actions Required

  • Upgrade Python to patched versions: 3.8.18, 3.9.18, 3.10.13, or 3.11.5 or later
  • Review and inventory all applications using Python TLS server-side sockets with client certificate authentication
  • Implement additional application-layer authentication as defense in depth while patches are deployed
  • Monitor affected systems for exploitation attempts until patching is complete

Patch Information

Python has released security patches addressing this vulnerability across multiple supported versions. Administrators should upgrade to Python 3.8.18 or later, 3.9.18 or later, 3.10.13 or later, or 3.11.5 or later depending on their current version branch. Additional vendor-specific patches are available through various distribution channels including Debian LTS and NetApp. For detailed security information, refer to the Python Security Development Information page.

Workarounds

  • Implement additional authentication checks at the application layer that do not solely rely on TLS client certificates
  • Add explicit connection state verification in application code before processing data from SSLSocket connections
  • Consider implementing connection timeout controls to limit the exploitation window
  • Deploy network-level controls to limit connection rates to TLS-authenticated services
bash
# Check current Python version
python3 --version

# Verify if running a vulnerable version (affected: <3.8.18, 3.9.x<3.9.18, 3.10.x<3.10.13, 3.11.x<3.11.5)
# Upgrade Python using your package manager
# For Debian/Ubuntu:
sudo apt update && sudo apt upgrade python3

# For systems with pyenv:
pyenv install 3.11.5
pyenv global 3.11.5

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

  • Vulnerability Details
  • TypeInformation Disclosure

  • Vendor/TechPython

  • SeverityMEDIUM

  • CVSS Score5.3

  • EPSS Probability0.58%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • NVD-CWE-noinfo
  • Technical References
  • Debian LTS Announcement September 2023

  • Debian LTS Announcement October 2023

  • Python Security Announcement Thread

  • NetApp Security Advisory NTAP-20231006-0014

  • Debian LTS Announcement November 2024

  • Debian LTS Announcement December 2024
  • Vendor Resources
  • Python Security Development Information
  • Related CVEs
  • CVE-2026-2297: CPython Information Disclosure Vulnerability

  • CVE-2025-12781: Python base64 Module Data Integrity Flaw

  • CVE-2021-28861: Python Open Redirection Vulnerability

  • CVE-2024-4032: Python ipaddress Module Info Disclosure
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
  • English
  • 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