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

- Severity: High 7.4 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.81%, higher than 58% of CVEs (2026-12-01)
- Published: 2024-06-17T15:09:40.896Z
- Modified: 2026-06-17T06:53:24.863Z
- Also known as: PSF-2024-4, BIT-LIBPYTHON-2024-0397, BIT-PYTHON-2024-0397, BIT-PYTHON-MIN-2024-0397
- Weaknesses: CWE-362
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: PSF

## 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.

(As written by CVE List.)

## Affected

- Python Software Foundation CPython: before 3.8.20; from 3.9.0 before 3.9.20; from 3.10.0 before 3.10.14; from 3.11.0 before 3.11.9; from 3.12.0 before 3.12.3; from 3.13.0a1 before 3.13.0a5
- python_software_foundation cpython: before 3.8.20; from 3.9.0 before 3.9.20; from 3.10.0 before 3.10.14; from 3.11.0 before 3.11.9; from 3.12.0 before 3.12.3; from 3.13.0a1 before 3.13.0a5
- https://github.com/python/cpython: before 01c37f1d0714f5822d34063ca7180b595abf589d; before 29c97287d205bf2f410f4895ebce3f43b5160524; before 37324b421b72b7bc9934e27aba85d48d4773002e; before 542f3272f56f31ed04e74c40635a913fbc12d286; before b228655c227b2ca298a8ffac44d14ce3d22f6faa; before bce693111bff906ccf9281c22371331aaff766ab
- libpython (Bitnami): before 3.8.20; from 3.9.0 before 3.9.20; from 3.10.0 before 3.10.14; from 3.11.0 before 3.11.9; from 3.12.0 before 3.12.3
- python (Bitnami): before 3.8.20; from 3.9.0 before 3.9.20; from 3.10.0 before 3.10.14; from 3.11.0 before 3.11.9; from 3.12.0 before 3.12.3
- python-min (Bitnami): before 3.8.20; from 3.9.0 before 3.9.20; from 3.10.0 before 3.10.14; from 3.11.0 before 3.11.9; from 3.12.0 before 3.12.3

## Every score

- CISA-ADP: 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`
- Bitnami Vulnerability Database: rating High

## References

- <https://github.com/python/cpython/issues/114572> (issue-tracking, report, web)
- <https://github.com/python/cpython/pull/114573> (patch, web)
- <https://mail.python.org/archives/list/security-announce@python.org/thread/BMAK5BCGKYWNJOACVUSLUF6SFGBIM4VP/> (advisory, vendor-advisory, web)
- <https://github.com/python/cpython/commit/01c37f1d0714f5822d34063ca7180b595abf589d> (fix, patch, web)
- <https://github.com/python/cpython/commit/29c97287d205bf2f410f4895ebce3f43b5160524> (fix, patch, web)
- <https://github.com/python/cpython/commit/37324b421b72b7bc9934e27aba85d48d4773002e> (fix, patch, web)
- <https://github.com/python/cpython/commit/542f3272f56f31ed04e74c40635a913fbc12d286> (fix, patch, web)
- <https://github.com/python/cpython/commit/b228655c227b2ca298a8ffac44d14ce3d22f6faa> (fix, patch, web)
- <https://github.com/python/cpython/commit/bce693111bff906ccf9281c22371331aaff766ab> (fix, patch, web)
- <http://www.openwall.com/lists/oss-security/2024/06/17/2> (web)
- <https://security.netapp.com/advisory/ntap-20250411-0006/> (web)
- <https://lists.debian.org/debian-lts-announce/2024/12/msg00000.html> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-0397> (web)

## Sources

- CVE List: [CVE-2024-0397](https://www.cve.org/CVERecord?id=CVE-2024-0397), CVE Terms of Use, modified 2025-11-03
- Python Software Foundation: [PSF-2024-4](https://osv.dev/vulnerability/PSF-2024-4), CC-BY-4.0, modified 2025-10-09
- NVD: [CVE-2024-0397](https://nvd.nist.gov/vuln/detail/CVE-2024-0397), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-LIBPYTHON-2024-0397](https://osv.dev/vulnerability/BIT-LIBPYTHON-2024-0397), Apache-2.0, modified 2026-05-11
- Bitnami Vulnerability Database: [BIT-PYTHON-2024-0397](https://osv.dev/vulnerability/BIT-PYTHON-2024-0397), Apache-2.0, modified 2026-05-11
- Bitnami Vulnerability Database: [BIT-PYTHON-MIN-2024-0397](https://osv.dev/vulnerability/BIT-PYTHON-MIN-2024-0397), Apache-2.0, modified 2026-05-11

---

Page: https://cve.day/CVE-2024-0397 · Whole record: https://cve.day/CVE-2024-0397.json · Rebuilt by cve.day 2026-11-25T22:58:41.951Z
