Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2024-0397: Vulnerability in Python Software Foundation CPython

0
High
VulnerabilityCVE-2024-0397cvecve-2024-0397
Published: Mon Jun 17 2024 (06/17/2024, 15:09:40 UTC)
Source: CVE Database V5
Vendor/Project: Python Software Foundation
Product: CPython

Description

A defect was discovered in the Python “ssl” module where there is a memory race condition with the ssl.SSLContext methods “cert_store_stats()” and “get_ca_certs()”. The race condition can be triggered if the methods are called at the same time as certificates are loaded into the SSLContext, such as during the TLS handshake with a certificate directory configured. This issue is fixed in CPython 3.10.14, 3.11.9, 3.12.3, and 3.13.0a5.

AI-Powered Analysis

AILast updated: 11/03/2025, 23:11:18 UTC

Technical Analysis

CVE-2024-0397 is a concurrency-related vulnerability in the Python Software Foundation's CPython implementation, specifically within the ssl module. The issue arises from a memory race condition between two SSLContext methods: cert_store_stats() and get_ca_certs(). These methods, when invoked simultaneously with the process of loading certificates into the SSLContext (such as during a TLS handshake when a certificate directory is configured), can cause unsafe concurrent access to internal data structures. This race condition can lead to memory corruption, which in turn may cause application crashes or denial of service. The vulnerability is classified under CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization). It affects multiple Python versions starting from 3.9.0 through to early 3.13 alpha releases. The Python Software Foundation has addressed the issue in versions 3.10.14, 3.11.9, 3.12.3, and 3.13.0a5. The CVSS v3.1 base score is 7.4, indicating high severity, with an attack vector of network (AV:N), high attack complexity (AC:H), no privileges required (PR:N), no user interaction (UI:N), unchanged scope (S:U), high confidentiality impact (C:H), no integrity impact (I:N), and high availability impact (A:H). No known exploits have been reported in the wild to date. The vulnerability primarily threatens the availability of Python applications using the ssl module for TLS connections, potentially causing service interruptions or crashes if exploited.

Potential Impact

For European organizations, the primary impact of CVE-2024-0397 is the risk of denial of service or application crashes in systems that rely on Python's ssl module for secure communications. This includes web servers, API endpoints, microservices, and other networked applications that perform TLS handshakes using CPython. Disruptions could affect critical services, especially in sectors like finance, healthcare, telecommunications, and government, where Python is widely used for backend services and automation. The confidentiality impact is rated high due to potential memory corruption, but no direct integrity compromise is indicated. The high attack complexity reduces the likelihood of widespread exploitation, but the lack of required privileges or user interaction means remote attackers could trigger the issue if they can initiate TLS handshakes. Organizations using older Python versions in production environments are particularly vulnerable. The absence of known exploits in the wild suggests limited immediate risk, but the vulnerability should be treated seriously given its potential to disrupt availability of critical services.

Mitigation Recommendations

1. Upgrade all Python environments to the patched versions: 3.10.14, 3.11.9, 3.12.3, or 3.13.0a5 as soon as possible. 2. Audit applications to identify usage of ssl.SSLContext methods cert_store_stats() and get_ca_certs(), especially in concurrent or multi-threaded contexts. 3. Avoid calling cert_store_stats() and get_ca_certs() concurrently with certificate loading or during TLS handshakes until patched versions are deployed. 4. Implement runtime monitoring for unexpected crashes or memory errors in Python applications handling TLS connections. 5. For critical systems where immediate upgrade is not feasible, consider isolating or limiting network exposure to reduce attack surface. 6. Engage in thorough testing of Python-based TLS services post-upgrade to ensure stability and correct certificate handling. 7. Stay informed on any emerging exploit reports or additional patches from the Python Software Foundation.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.2
Assigner Short Name
PSF
Date Reserved
2024-01-10T14:05:31.635Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 69092613fe7723195e0b3027

Added to database: 11/3/2025, 10:00:51 PM

Last enriched: 11/3/2025, 11:11:18 PM

Last updated: 11/5/2025, 1:22:28 PM

Views: 1

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats