CVEfocus › CVE database › CVE-2024-0397

CVE-2024-0397Memory race condition in ssl.SSLContext certificate store methods

CVSS 7.4 HighEPSS 0.8% (higher than 58% of CVEs)Published 2024-06-17Updated 2025-11-03Assigner: PSF

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.

CWE-362

What to do

Fixed builds are available from Debian, Red Hat, Ubuntu: see the table below for the fixed version per release.

Debian, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

28Fixed
12Fix pending
139Will not fix
10Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04python3.12Not affected
vulnerable_code_not_present
Ubuntu 22.04python2.7Fix pendingUBUNTU-CVE-2024-0397
Ubuntu 22.04python3.10Fixed3.10.12-1~22.04.5UBUNTU-CVE-2024-0397
Ubuntu 22.04python3.11Fix pendingUBUNTU-CVE-2024-0397
Ubuntu 20.04python2.7Fix pendingUBUNTU-CVE-2024-0397
Ubuntu 20.04python3.8Fixed3.8.10-0ubuntu1~20.04.11UBUNTU-CVE-2024-0397
Ubuntu 20.04python3.9Fix pendingUBUNTU-CVE-2024-0397
Ubuntu 18.04python2.7Fix pendingUBUNTU-CVE-2024-0397
Ubuntu 18.04python3.6Fix pendingUBUNTU-CVE-2024-0397
Ubuntu 18.04python3.7Fix pendingUBUNTU-CVE-2024-0397
Ubuntu 18.04python3.8Fix pendingUBUNTU-CVE-2024-0397
Ubuntu 16.04python2.7Fix pendingUBUNTU-CVE-2024-0397
Ubuntu 14.04python2.7Fix pendingUBUNTU-CVE-2024-0397
Ubuntu 14.04python3.4Fix pendingUBUNTU-CVE-2024-0397
Debian 14pypy3Fixed7.3.16+dfsg-1DEBIAN-CVE-2024-0397
Debian 13pypy3Fixed7.3.16+dfsg-1DEBIAN-CVE-2024-0397
Debian 12pypy3Fix pendingDEBIAN-CVE-2024-0397
Debian 12python3.11Fixed3.11.2-6+deb12u3DEBIAN-CVE-2024-0397
Red Hat Enterprise Linux 10python-unversioned-commandNot affected
Red Hat Enterprise Linux 10python3Not affected
Red Hat Enterprise Linux 10python3-debugNot affected
Red Hat Enterprise Linux 10python3-develNot affected
Red Hat Enterprise Linux 10python3-idleNot affected
Red Hat Enterprise Linux 10python3-libsNot affected
Red Hat Enterprise Linux 10python3-testNot affected
Red Hat Enterprise Linux 10python3-tkinterNot affected
Red Hat Enterprise Linux 10python3.12Not affected
Red Hat Enterprise Linux 9python-unversioned-commandFixed0:3.9.21-1.el9_5RHSA-2024:10983
Red Hat Enterprise Linux 9python3Fixed0:3.9.21-1.el9_5RHSA-2024:10983
Red Hat Enterprise Linux 9python3-debugFixed0:3.9.21-1.el9_5RHSA-2024:10983
Red Hat Enterprise Linux 9python3-develFixed0:3.9.21-1.el9_5RHSA-2024:10983
Red Hat Enterprise Linux 9python3-idleFixed0:3.9.21-1.el9_5RHSA-2024:10983
Red Hat Enterprise Linux 9python3-libsFixed0:3.9.21-1.el9_5RHSA-2024:10983
Red Hat Enterprise Linux 9python3-testFixed0:3.9.21-1.el9_5RHSA-2024:10983
Red Hat Enterprise Linux 9python3-tkinterFixed0:3.9.21-1.el9_5RHSA-2024:10983
Red Hat Enterprise Linux 9python3.11Fixed0:3.11.9-7.el9RHSA-2024:9192
Red Hat Enterprise Linux 9python3.11-debugFixed0:3.11.9-7.el9RHSA-2024:9192
Red Hat Enterprise Linux 9python3.11-develFixed0:3.11.9-7.el9RHSA-2024:9192
Red Hat Enterprise Linux 9python3.11-idleFixed0:3.11.9-7.el9RHSA-2024:9192
Red Hat Enterprise Linux 9python3.11-libsFixed0:3.11.9-7.el9RHSA-2024:9192
Red Hat Enterprise Linux 9python3.11-testFixed0:3.11.9-7.el9RHSA-2024:9192
Red Hat Enterprise Linux 9python3.11-tkinterFixed0:3.11.9-7.el9RHSA-2024:9192
Red Hat Enterprise Linux 9python3.12Fixed0:3.12.5-2.el9RHSA-2024:9190
Red Hat Enterprise Linux 9python3.12-debugFixed0:3.12.5-2.el9RHSA-2024:9190
Red Hat Enterprise Linux 9python3.12-develFixed0:3.12.5-2.el9RHSA-2024:9190
Red Hat Enterprise Linux 9python3.12-idleFixed0:3.12.5-2.el9RHSA-2024:9190
Red Hat Enterprise Linux 9python3.12-libsFixed0:3.12.5-2.el9RHSA-2024:9190
Red Hat Enterprise Linux 9python3.12-testFixed0:3.12.5-2.el9RHSA-2024:9190
Red Hat Enterprise Linux 9python3.12-tkinterFixed0:3.12.5-2.el9RHSA-2024:9190
Red Hat Enterprise Linux 9python3.9Fixed0:3.9.21-1.el9_5RHSA-2024:10983
Red Hat Enterprise Linux 8PyYAMLWill not fix
Out of support scope
Red Hat Enterprise Linux 8mod_wsgiWill not fix
Out of support scope
Red Hat Enterprise Linux 8numpyWill not fix
Out of support scope
Red Hat Enterprise Linux 8platform-pythonWill not fix
Out of support scope
Red Hat Enterprise Linux 8platform-python-debugWill not fix
Out of support scope
Red Hat Enterprise Linux 8platform-python-develWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-PyMySQLWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-cffiWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-chardetWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-cryptographyWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-distroWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-docsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-docutilsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-idnaWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-lxmlWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-noseWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-nose-docsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-plyWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-psutilWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-psycopg2Will not fix
Out of support scope
Red Hat Enterprise Linux 8python-pycparserWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-pygmentsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-pymongoWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-pymongo-docWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-pysocksWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-requestsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-sqlalchemyWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-sqlalchemy-docWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-tomlWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-urllib3Will not fix
Out of support scope
Red Hat Enterprise Linux 8python-virtualenvWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-virtualenv-docWill not fix
Out of support scope
Red Hat Enterprise Linux 8python-wheelWill not fix
Out of support scope
Red Hat Enterprise Linux 8python2Will not fix
Out of support scope
Red Hat Enterprise Linux 8python2-debugWill not fix
Out of support scope
Red Hat Enterprise Linux 8python2-develWill not fix
Out of support scope
Red Hat Enterprise Linux 8python2-libsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python2-testWill not fix
Out of support scope
Red Hat Enterprise Linux 8python2-tkinterWill not fix
Out of support scope
Red Hat Enterprise Linux 8python2-toolsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3Will not fix
Out of support scope
Red Hat Enterprise Linux 8python3-PyMySQLWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-bsonWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-distroWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-docsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-docutilsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-idleWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-libsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-noseWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-pygmentsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-pymongoWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-pymongo-gridfsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-scipyWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-sqlalchemyWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-testWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-tkinterWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-virtualenvWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-wheelWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3-wheel-wheelWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.11Will not fix
Out of support scope
Red Hat Enterprise Linux 8python3.11-debugWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.11-develWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.11-idleWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.11-libsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.11-rpm-macrosWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.11-testWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.11-tkinterWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.12Will not fix
Out of support scope
Red Hat Enterprise Linux 8python3.12-debugWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.12-develWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.12-idleWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.12-libsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.12-rpm-macrosWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.12-testWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3.12-tkinterWill not fix
Out of support scope
Red Hat Enterprise Linux 8python36Will not fix
Out of support scope
Red Hat Enterprise Linux 8python36-debugWill not fix
Out of support scope
Red Hat Enterprise Linux 8python36-develWill not fix
Out of support scope
Red Hat Enterprise Linux 8python36-rpm-macrosWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39Will not fix
Out of support scope
Red Hat Enterprise Linux 8python39-PyMySQLWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-cffiWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-chardetWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-cryptographyWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-develWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-idleWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-idnaWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-libsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-lxmlWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-mod_wsgiWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-numpyWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-numpy-docWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-numpy-f2pyWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-pipWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-pip-wheelWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-plyWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-psutilWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-psycopg2Will not fix
Out of support scope
Red Hat Enterprise Linux 8python39-psycopg2-docWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-psycopg2-testsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-pycparserWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-pysocksWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-pyyamlWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-requestsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-rpm-macrosWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-scipyWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-setuptoolsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-setuptools-wheelWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-sixWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-testWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-tkinterWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-tomlWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-urllib3Will not fix
Out of support scope
Red Hat Enterprise Linux 8python39-wheelWill not fix
Out of support scope
Red Hat Enterprise Linux 8python39-wheel-wheelWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3x-pipWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3x-setuptoolsWill not fix
Out of support scope
Red Hat Enterprise Linux 8python3x-sixWill not fix
Out of support scope
Red Hat Enterprise Linux 8scipyWill not fix
Out of support scope
Red Hat Enterprise Linux 7pythonWill not fix
Out of support scope
Red Hat Enterprise Linux 7python-debugWill not fix
Out of support scope
Red Hat Enterprise Linux 7python-develWill not fix
Out of support scope
Red Hat Enterprise Linux 7python-libsWill not fix
Out of support scope
Red Hat Enterprise Linux 7python-testWill not fix
Out of support scope
Red Hat Enterprise Linux 7python-toolsWill not fix
Out of support scope
Red Hat Enterprise Linux 7python3Will not fix
Out of support scope
Red Hat Enterprise Linux 7python3-debugWill not fix
Out of support scope
Red Hat Enterprise Linux 7python3-develWill not fix
Out of support scope
Red Hat Enterprise Linux 7python3-idleWill not fix
Out of support scope
Red Hat Enterprise Linux 7python3-libsWill not fix
Out of support scope
Red Hat Enterprise Linux 7python3-testWill not fix
Out of support scope
Red Hat Enterprise Linux 7python3-tkinterWill not fix
Out of support scope
Red Hat Enterprise Linux 7tkinterWill not fix
Out of support scope
Red Hat Enterprise Linux 6pythonWill not fix
Out of support scope
Red Hat Enterprise Linux 6python-develWill not fix
Out of support scope
Red Hat Enterprise Linux 6python-libsWill not fix
Out of support scope
Red Hat Enterprise Linux 6python-testWill not fix
Out of support scope
Red Hat Enterprise Linux 6python-toolsWill not fix
Out of support scope
Red Hat Enterprise Linux 6tkinterWill not fix
Out of support scope

What the vendor says

As published in the CVE record by PSF, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.