cve.bz

CVE-2024-0397 python software foundation cpython: Race Condition

7.4 highEPSS 0.8%

High (7.4) in python software foundation cpython. EPSS 0.8% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

7.4 high
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H
EPSS
0.8% (unchanged from 0.8% a week ago; 0.8% 30 days ago) estimated probability of exploitation activity in the next 30 days; 58th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2024-06-20. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization (Race Condition)
OWASP Top 10
A06:2025 Insecure Design
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-0397 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-0397?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-0397?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-0397 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Python Software Foundation CPythonbefore 3.8.20
Python Software Foundation CPythonfrom 3.9.0 before 3.9.20
Python Software Foundation CPythonfrom 3.10.0 before 3.10.14
Python Software Foundation CPythonfrom 3.11.0 before 3.11.9
Python Software Foundation CPythonfrom 3.12.0 before 3.12.3
Python Software Foundation CPythonfrom 3.13.0a1 before 3.13.0a5

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11python3.93.9.2-1+deb11u2DLA-3980-1
Debian12pypy3no fix listedDEBIAN-CVE-2024-0397
Debian12python3.113.11.2-6+deb12u3DEBIAN-CVE-2024-0397 DSA-5759-1
Debian13, 14pypy37.3.16+dfsg-1DEBIAN-CVE-2024-0397
Ubuntu20.04:LTSpython3.83.8.10-0ubuntu1~20.04.11UBUNTU-CVE-2024-0397 USN-6928-1
Ubuntu22.04:LTSpython3.103.10.12-1~22.04.5UBUNTU-CVE-2024-0397 USN-6928-1
UbuntuPro:14.04:LTSpython2.7, python3.4no fix listedUBUNTU-CVE-2024-0397
UbuntuPro:16.04:LTSpython2.7no fix listedUBUNTU-CVE-2024-0397
UbuntuPro:18.04:LTSpython2.7, python3.6, python3.7 and 1 moreno fix listedUBUNTU-CVE-2024-0397
UbuntuPro:20.04:LTSpython2.7, python3.9no fix listedUBUNTU-CVE-2024-0397
UbuntuPro:22.04:LTSpython2.7, python3.11no fix listedUBUNTU-CVE-2024-0397
Red Hatenterprise_linux:9::appstreampython3-devel, python3-tkinter, python3.9-debuginfo and 2 more0:3.9.21-1.el9_5RHSA-2024:10983
Red Hatenterprise_linux:9::appstreampython3.11, python3.11-libs, python3.11-devel and 3 more0:3.11.9-7.el9RHSA-2024:9192
Red Hatenterprise_linux:9::appstreampython3.12, python3.12-libs, python3.12-devel and 3 more0:3.12.5-2.el9RHSA-2024:9190
Red Hatenterprise_linux:9::baseospython3, python3.9, python3-libs and 2 more0:3.9.21-1.el9_5RHSA-2024:10983
Red Hatenterprise_linux:9::crbpython3, python3-idle, python3-test and 4 more0:3.9.21-1.el9_5RHSA-2024:10983
Red Hatenterprise_linux:9::crbpython3.11, python3.11-idle, python3.11-test and 4 more0:3.11.9-7.el9RHSA-2024:9192
Red Hatenterprise_linux:9::crbpython3.12, python3.12-idle, python3.12-test and 4 more0:3.12.5-2.el9RHSA-2024:9190
SUSEEL-9:Update:Products:SaltBundle:Updatesaltbundlepy, saltbundlepy-core3.11.9-1.26.1SUSE-SU-2024:4029-1
SUSEEL-9:Update:Products:SaltBundle:Updatesaltbundlepy-cryptography3.3.2-1.18.1SUSE-SU-2024:4029-1
SUSEEL-9:Update:Products:SaltBundle:Updatesaltbundlepy-docker7.0.0-1.8.1SUSE-SU-2024:4029-1
SUSEEL-9:Update:Products:SaltBundle:Updatesaltbundlepy-idna3.4-1.9.2SUSE-SU-2024:4029-1
SUSEEL-9:Update:Products:SaltBundle:Updatesaltbundlepy-passlib, saltbundlepy-passlib-test1.7.4-1.3.1SUSE-SU-2024:4029-1
SUSEEL-9:Update:Products:SaltBundle:Updatesaltbundlepy-setuptools67.7.2-1.12.1SUSE-SU-2024:4029-1
SUSEEL-9:Update:Products:SaltBundle:Updatesaltbundlepy-urllib32.0.7-1.12.1SUSE-SU-2024:4029-1
SUSEEL-9:Update:Products:SaltBundle:Updatesaltbundlepy-zipp3.15.0-1.9.2SUSE-SU-2024:4029-1
SUSEEL-9:Update:Products:SaltBundle:Update, Manager Client Tools for RHEL, Liberty and Clones 9-CLIENT-TOOLSvenv-salt-minion3006.0-1.47.1SUSE-SU-2024:4029-1
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP3-LTSS, Linux Enterprise High Performance Computing 15 SP4-ESPOS and 15 morepython3-core3.6.15-150300.10.65.1SUSE-SU-2024:2479-1
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP3-LTSS, Linux Enterprise High Performance Computing 15 SP4-ESPOS and 13 morepython33.6.15-150300.10.65.2SUSE-SU-2024:2479-1
SUSELinux Enterprise Micro 5.1python3, python3-core3.6.15-150000.3.150.1SUSE-SU-2024:2249-1
12 more for SUSE in the JSON and on SUSE's page.
openSUSELeap 15.5, Leap 15.6python3-core, python3-documentation3.6.15-150300.10.65.1SUSE-SU-2024:2479-1
openSUSELeap 15.5, Leap 15.6python39, python39-core, python39-documentation3.9.19-150300.4.46.1SUSE-SU-2024:2280-1
openSUSELeap 15.5, Leap 15.6, Leap Micro 5.3 and 1 morepython33.6.15-150300.10.65.2SUSE-SU-2024:2479-1
openSUSELeap 15.6python311, python311-core, python311-documentation3.11.9-150600.3.3.1SUSE-SU-2025:02089-1
openSUSELeap 15.6python312, python312-core, python312-documentation3.12.4-150600.3.3.1SUSE-SU-2024:2572-1
openSUSELeap Micro 5.3, Leap Micro 5.4python3-core3.6.15-150300.10.65.1SUSE-SU-2024:2479-1
openSUSETumbleweedpython3103.10.14-2.1openSUSE-SU-2024:14066-1
openSUSETumbleweedpython3113.11.9-3.1openSUSE-SU-2024:14082-1
openSUSETumbleweedpython3123.12.5-1.1openSUSE-SU-2024:14295-1
openSUSETumbleweedpython383.8.19-3.1openSUSE-SU-2024:14063-1
openSUSETumbleweedpython393.9.19-2.1openSUSE-SU-2024:14064-1
Azure Linux2python33.9.19-3AZL-42796
Azure Linux3python33.12.3-1AZL-42784

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Low.

Red Hat's statement

This vulnerability is classified as low severity instead of moderate because it primarily results in a race condition that can cause unexpected behavior or crashes but does not directly lead to memory corruption, information disclosure, or remote code execution.

The issue is constrained to scenarios where multiple threads interact with SSLContext during certificate loading, which is an uncommon pattern in typical applications. Additionally, exploitation would require precise timing and a specific application design that exposes these methods to concurrent access, reducing the likelihood of real-world impact.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 9python3.9-0:3.9.21-1.el9_5Fixed 2024-12-12RHSA-2024:10983
Red Hat Enterprise Linux 9python3.12-0:3.12.5-2.el9Fixed 2024-11-12RHSA-2024:9190
Red Hat Enterprise Linux 9python3.11-0:3.11.9-7.el9Fixed 2024-11-12RHSA-2024:9192
Red Hat Enterprise Linux 10python3.12Not affected
Red Hat Enterprise Linux 6pythonOut of support scope
Red Hat Enterprise Linux 7pythonOut of support scope
Red Hat Enterprise Linux 7python3Out of support scope
Red Hat Enterprise Linux 8gimp:flatpak/python2Out of support scope
Red Hat Enterprise Linux 8python3Out of support scope
Red Hat Enterprise Linux 8python3.11Out of support scope
Red Hat Enterprise Linux 8python3.12Out of support scope
Red Hat Enterprise Linux 8python36:3.6/python36Out of support scope
Red Hat Enterprise Linux 8python39:3.9/python39Out of support scope
Red Hat Enterprise Linux 8python39-devel:3.9/python39Out of support scope

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2024-0397.

Attack patterns (CAPEC)

  • CAPEC-26 Leveraging Race Conditions Likelihood: High · Severity: High
  • CAPEC-29 Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON