CVE-2024-0397Memory race condition in ssl.SSLContext certificate store methods
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.
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
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.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | python3.12 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | python2.7 | Fix pending | UBUNTU-CVE-2024-0397 | |
| Ubuntu 22.04 | python3.10 | Fixed | 3.10.12-1~22.04.5 | UBUNTU-CVE-2024-0397 |
| Ubuntu 22.04 | python3.11 | Fix pending | UBUNTU-CVE-2024-0397 | |
| Ubuntu 20.04 | python2.7 | Fix pending | UBUNTU-CVE-2024-0397 | |
| Ubuntu 20.04 | python3.8 | Fixed | 3.8.10-0ubuntu1~20.04.11 | UBUNTU-CVE-2024-0397 |
| Ubuntu 20.04 | python3.9 | Fix pending | UBUNTU-CVE-2024-0397 | |
| Ubuntu 18.04 | python2.7 | Fix pending | UBUNTU-CVE-2024-0397 | |
| Ubuntu 18.04 | python3.6 | Fix pending | UBUNTU-CVE-2024-0397 | |
| Ubuntu 18.04 | python3.7 | Fix pending | UBUNTU-CVE-2024-0397 | |
| Ubuntu 18.04 | python3.8 | Fix pending | UBUNTU-CVE-2024-0397 | |
| Ubuntu 16.04 | python2.7 | Fix pending | UBUNTU-CVE-2024-0397 | |
| Ubuntu 14.04 | python2.7 | Fix pending | UBUNTU-CVE-2024-0397 | |
| Ubuntu 14.04 | python3.4 | Fix pending | UBUNTU-CVE-2024-0397 | |
| Debian 14 | pypy3 | Fixed | 7.3.16+dfsg-1 | DEBIAN-CVE-2024-0397 |
| Debian 13 | pypy3 | Fixed | 7.3.16+dfsg-1 | DEBIAN-CVE-2024-0397 |
| Debian 12 | pypy3 | Fix pending | DEBIAN-CVE-2024-0397 | |
| Debian 12 | python3.11 | Fixed | 3.11.2-6+deb12u3 | DEBIAN-CVE-2024-0397 |
| Red Hat Enterprise Linux 10 | python-unversioned-command | Not affected | ||
| Red Hat Enterprise Linux 10 | python3 | Not affected | ||
| Red Hat Enterprise Linux 10 | python3-debug | Not affected | ||
| Red Hat Enterprise Linux 10 | python3-devel | Not affected | ||
| Red Hat Enterprise Linux 10 | python3-idle | Not affected | ||
| Red Hat Enterprise Linux 10 | python3-libs | Not affected | ||
| Red Hat Enterprise Linux 10 | python3-test | Not affected | ||
| Red Hat Enterprise Linux 10 | python3-tkinter | Not affected | ||
| Red Hat Enterprise Linux 10 | python3.12 | Not affected | ||
| Red Hat Enterprise Linux 9 | python-unversioned-command | Fixed | 0:3.9.21-1.el9_5 | RHSA-2024:10983 |
| Red Hat Enterprise Linux 9 | python3 | Fixed | 0:3.9.21-1.el9_5 | RHSA-2024:10983 |
| Red Hat Enterprise Linux 9 | python3-debug | Fixed | 0:3.9.21-1.el9_5 | RHSA-2024:10983 |
| Red Hat Enterprise Linux 9 | python3-devel | Fixed | 0:3.9.21-1.el9_5 | RHSA-2024:10983 |
| Red Hat Enterprise Linux 9 | python3-idle | Fixed | 0:3.9.21-1.el9_5 | RHSA-2024:10983 |
| Red Hat Enterprise Linux 9 | python3-libs | Fixed | 0:3.9.21-1.el9_5 | RHSA-2024:10983 |
| Red Hat Enterprise Linux 9 | python3-test | Fixed | 0:3.9.21-1.el9_5 | RHSA-2024:10983 |
| Red Hat Enterprise Linux 9 | python3-tkinter | Fixed | 0:3.9.21-1.el9_5 | RHSA-2024:10983 |
| Red Hat Enterprise Linux 9 | python3.11 | Fixed | 0:3.11.9-7.el9 | RHSA-2024:9192 |
| Red Hat Enterprise Linux 9 | python3.11-debug | Fixed | 0:3.11.9-7.el9 | RHSA-2024:9192 |
| Red Hat Enterprise Linux 9 | python3.11-devel | Fixed | 0:3.11.9-7.el9 | RHSA-2024:9192 |
| Red Hat Enterprise Linux 9 | python3.11-idle | Fixed | 0:3.11.9-7.el9 | RHSA-2024:9192 |
| Red Hat Enterprise Linux 9 | python3.11-libs | Fixed | 0:3.11.9-7.el9 | RHSA-2024:9192 |
| Red Hat Enterprise Linux 9 | python3.11-test | Fixed | 0:3.11.9-7.el9 | RHSA-2024:9192 |
| Red Hat Enterprise Linux 9 | python3.11-tkinter | Fixed | 0:3.11.9-7.el9 | RHSA-2024:9192 |
| Red Hat Enterprise Linux 9 | python3.12 | Fixed | 0:3.12.5-2.el9 | RHSA-2024:9190 |
| Red Hat Enterprise Linux 9 | python3.12-debug | Fixed | 0:3.12.5-2.el9 | RHSA-2024:9190 |
| Red Hat Enterprise Linux 9 | python3.12-devel | Fixed | 0:3.12.5-2.el9 | RHSA-2024:9190 |
| Red Hat Enterprise Linux 9 | python3.12-idle | Fixed | 0:3.12.5-2.el9 | RHSA-2024:9190 |
| Red Hat Enterprise Linux 9 | python3.12-libs | Fixed | 0:3.12.5-2.el9 | RHSA-2024:9190 |
| Red Hat Enterprise Linux 9 | python3.12-test | Fixed | 0:3.12.5-2.el9 | RHSA-2024:9190 |
| Red Hat Enterprise Linux 9 | python3.12-tkinter | Fixed | 0:3.12.5-2.el9 | RHSA-2024:9190 |
| Red Hat Enterprise Linux 9 | python3.9 | Fixed | 0:3.9.21-1.el9_5 | RHSA-2024:10983 |
| Red Hat Enterprise Linux 8 | PyYAML | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | mod_wsgi | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | numpy | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | platform-python | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | platform-python-debug | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | platform-python-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-PyMySQL | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-cffi | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-chardet | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-cryptography | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-distro | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-docs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-docutils | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-idna | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-lxml | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-nose | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-nose-docs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-ply | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-psutil | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-psycopg2 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-pycparser | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-pygments | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-pymongo | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-pymongo-doc | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-pysocks | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-requests | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-sqlalchemy | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-sqlalchemy-doc | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-toml | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-urllib3 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-virtualenv | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-virtualenv-doc | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python-wheel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python2 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python2-debug | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python2-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python2-libs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python2-test | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python2-tkinter | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python2-tools | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-PyMySQL | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-bson | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-distro | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-docs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-docutils | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-idle | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-libs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-nose | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-pygments | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-pymongo | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-pymongo-gridfs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-scipy | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-sqlalchemy | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-test | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-tkinter | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-virtualenv | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-wheel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3-wheel-wheel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.11 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.11-debug | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.11-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.11-idle | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.11-libs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.11-rpm-macros | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.11-test | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.11-tkinter | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.12 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.12-debug | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.12-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.12-idle | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.12-libs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.12-rpm-macros | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.12-test | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3.12-tkinter | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python36 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python36-debug | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python36-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python36-rpm-macros | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-PyMySQL | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-cffi | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-chardet | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-cryptography | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-idle | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-idna | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-libs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-lxml | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-mod_wsgi | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-numpy | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-numpy-doc | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-numpy-f2py | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-pip | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-pip-wheel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-ply | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-psutil | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-psycopg2 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-psycopg2-doc | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-psycopg2-tests | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-pycparser | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-pysocks | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-pyyaml | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-requests | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-rpm-macros | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-scipy | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-setuptools | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-setuptools-wheel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-six | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-test | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-tkinter | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-toml | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-urllib3 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-wheel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python39-wheel-wheel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3x-pip | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3x-setuptools | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | python3x-six | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 8 | scipy | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python-debug | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python-libs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python-test | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python-tools | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python3 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python3-debug | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python3-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python3-idle | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python3-libs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python3-test | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python3-tkinter | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | tkinter | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-libs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-test | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-tools | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | tkinter | Will 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.
- Python Software Foundation CPython: affected: before 3.8.20, 3.9.0 to before 3.9.20, 3.10.0 to before 3.10.14, 3.11.0 to before 3.11.9, 3.12.0 to before 3.12.3, 3.13.0a1 to before 3.13.0a5; fixed in
3.8.20,3.9.20,3.10.14,3.11.9,3.12.3,3.13.0a5
Vendor advisories:
- https://github.com/python/cpython/pull/114573 (patch)
- https://mail.python.org/archives/list/security-announce@python.org/thread/BMAK5BCGKYWNJOA… (vendor-advisory)
- https://github.com/python/cpython/commit/01c37f1d0714f5822d34063ca7180b595abf589d (patch)
- https://github.com/python/cpython/commit/29c97287d205bf2f410f4895ebce3f43b5160524 (patch)
- https://github.com/python/cpython/commit/37324b421b72b7bc9934e27aba85d48d4773002e (patch)
- https://github.com/python/cpython/commit/542f3272f56f31ed04e74c40635a913fbc12d286 (patch)
References
- https://github.com/python/cpython/issues/114572
- https://github.com/python/cpython/pull/114573
- https://mail.python.org/archives/list/security-announce@python.org/thread/BMAK5BCGKYWNJOACVUSLUF6SFGBIM4VP/
- https://github.com/python/cpython/commit/01c37f1d0714f5822d34063ca7180b595abf589d
- https://github.com/python/cpython/commit/29c97287d205bf2f410f4895ebce3f43b5160524
- https://github.com/python/cpython/commit/37324b421b72b7bc9934e27aba85d48d4773002e
- https://github.com/python/cpython/commit/542f3272f56f31ed04e74c40635a913fbc12d286
- https://github.com/python/cpython/commit/b228655c227b2ca298a8ffac44d14ce3d22f6faa
- https://github.com/python/cpython/commit/bce693111bff906ccf9281c22371331aaff766ab
- http://www.openwall.com/lists/oss-security/2024/06/17/2
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.