{"id":"CVE-2024-0397","state":"PUBLISHED","title":"Memory race condition in ssl.SSLContext certificate store methods","description":"A defect was discovered in the Python “ssl” module where there is a memory\nrace condition with the ssl.SSLContext methods “cert_store_stats()” and\n“get_ca_certs()”. The race condition can be triggered if the methods are\ncalled at the same time as certificates are loaded into the SSLContext,\nsuch as during the TLS handshake with a certificate directory configured.\nThis issue is fixed in CPython 3.10.14, 3.11.9, 3.12.3, and 3.13.0a5.","publishedAt":"2024-06-17T15:09:40.896Z","updatedAt":"2025-11-03T21:50:55.091Z","severity":{"score":7.4,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H","source":"CISA-ADP"},"assigner":"PSF","products":["Python Software Foundation CPython"],"affected":[{"vendor":"Python Software Foundation","product":"CPython","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"3.8.20","versionType":"python"},{"version":"3.9.0","status":"affected","lessThan":"3.9.20","versionType":"python"},{"version":"3.10.0","status":"affected","lessThan":"3.10.14","versionType":"python"},{"version":"3.11.0","status":"affected","lessThan":"3.11.9","versionType":"python"},{"version":"3.12.0","status":"affected","lessThan":"3.12.3","versionType":"python"},{"version":"3.13.0a1","status":"affected","lessThan":"3.13.0a5","versionType":"python"}],"repo":"https://github.com/python/cpython"}],"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","https://security.netapp.com/advisory/ntap-20250411-0006/","https://lists.debian.org/debian-lts-announce/2024/12/msg00000.html"],"weaknesses":["CWE-362"],"ingestedAt":"2026-10-29T20:06:42.242Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/0xxx/CVE-2024-0397.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-0397","state":"PUBLISHED","datePublished":"2024-06-17T15:09:40.896Z","dateUpdated":"2025-11-03T21:50:55.091Z","assignerShortName":"PSF","assignerOrgId":"28c92f92-d60d-412d-b760-e73465c3df22","dateReserved":"2024-01-10T14:05:31.635Z"},"containers":{"cna":{"title":"Memory race condition in ssl.SSLContext certificate store methods","descriptions":[{"lang":"en","value":"A defect was discovered in the Python “ssl” module where there is a memory\nrace condition with the ssl.SSLContext methods “cert_store_stats()” and\n“get_ca_certs()”. The race condition can be triggered if the methods are\ncalled at the same time as certificates are loaded into the SSLContext,\nsuch as during the TLS handshake with a certificate directory configured.\nThis issue is fixed in CPython 3.10.14, 3.11.9, 3.12.3, and 3.13.0a5."}],"affected":[{"vendor":"Python Software Foundation","product":"CPython","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"3.8.20","versionType":"python"},{"version":"3.9.0","status":"affected","lessThan":"3.9.20","versionType":"python"},{"version":"3.10.0","status":"affected","lessThan":"3.10.14","versionType":"python"},{"version":"3.11.0","status":"affected","lessThan":"3.11.9","versionType":"python"},{"version":"3.12.0","status":"affected","lessThan":"3.12.3","versionType":"python"},{"version":"3.13.0a1","status":"affected","lessThan":"3.13.0a5","versionType":"python"}],"repo":"https://github.com/python/cpython"}],"references":[{"url":"https://github.com/python/cpython/issues/114572","tags":["issue-tracking"]},{"url":"https://github.com/python/cpython/pull/114573","tags":["patch"]},{"url":"https://mail.python.org/archives/list/security-announce@python.org/thread/BMAK5BCGKYWNJOACVUSLUF6SFGBIM4VP/","tags":["vendor-advisory"]},{"url":"https://github.com/python/cpython/commit/01c37f1d0714f5822d34063ca7180b595abf589d","tags":["patch"]},{"url":"https://github.com/python/cpython/commit/29c97287d205bf2f410f4895ebce3f43b5160524","tags":["patch"]},{"url":"https://github.com/python/cpython/commit/37324b421b72b7bc9934e27aba85d48d4773002e","tags":["patch"]},{"url":"https://github.com/python/cpython/commit/542f3272f56f31ed04e74c40635a913fbc12d286","tags":["patch"]},{"url":"https://github.com/python/cpython/commit/b228655c227b2ca298a8ffac44d14ce3d22f6faa","tags":["patch"]},{"url":"https://github.com/python/cpython/commit/bce693111bff906ccf9281c22371331aaff766ab","tags":["patch"]},{"url":"http://www.openwall.com/lists/oss-security/2024/06/17/2"}],"providerMetadata":{"shortName":"PSF","orgId":"28c92f92-d60d-412d-b760-e73465c3df22","dateUpdated":"2024-09-07T02:44:08.540Z"},"source":{"discovery":"UNKNOWN"},"x_generator":{"engine":"Vulnogram 0.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","affected":[{"vendor":"python_software_foundation","product":"cpython","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"3.8.20","versionType":"python"},{"version":"3.9.0","status":"affected","lessThan":"3.9.20","versionType":"python"},{"version":"3.10.0","status":"affected","lessThan":"3.10.14","versionType":"python"},{"version":"3.11.0","status":"affected","lessThan":"3.11.9","versionType":"python"},{"version":"3.12.0","status":"affected","lessThan":"3.12.3","versionType":"python"},{"version":"3.13.0a1","status":"affected","lessThan":"3.13.0a5","versionType":"python"}],"cpes":["cpe:2.3:a:python_software_foundation:cpython:*:*:*:*:*:*:*:*"]}],"metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.4,"attackVector":"NETWORK","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H","integrityImpact":"NONE","userInteraction":"NONE","attackComplexity":"HIGH","availabilityImpact":"HIGH","privilegesRequired":"NONE","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"timestamp":"2024-06-20T15:52:27.499743Z","id":"CVE-2024-0397","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-362","type":"CWE","lang":"en","description":"CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-09-17T18:24:43.948Z"}},{"title":"CVE Program Container","references":[{"url":"https://github.com/python/cpython/issues/114572","tags":["issue-tracking","x_transferred"]},{"url":"https://github.com/python/cpython/pull/114573","tags":["patch","x_transferred"]},{"url":"https://mail.python.org/archives/list/security-announce@python.org/thread/BMAK5BCGKYWNJOACVUSLUF6SFGBIM4VP/","tags":["vendor-advisory","x_transferred"]},{"url":"https://github.com/python/cpython/commit/01c37f1d0714f5822d34063ca7180b595abf589d","tags":["patch","x_transferred"]},{"url":"https://github.com/python/cpython/commit/29c97287d205bf2f410f4895ebce3f43b5160524","tags":["patch","x_transferred"]},{"url":"https://github.com/python/cpython/commit/37324b421b72b7bc9934e27aba85d48d4773002e","tags":["patch","x_transferred"]},{"url":"https://github.com/python/cpython/commit/542f3272f56f31ed04e74c40635a913fbc12d286","tags":["patch","x_transferred"]},{"url":"https://github.com/python/cpython/commit/b228655c227b2ca298a8ffac44d14ce3d22f6faa","tags":["patch","x_transferred"]},{"url":"https://github.com/python/cpython/commit/bce693111bff906ccf9281c22371331aaff766ab","tags":["patch","x_transferred"]},{"url":"http://www.openwall.com/lists/oss-security/2024/06/17/2","tags":["x_transferred"]},{"url":"https://security.netapp.com/advisory/ntap-20250411-0006/"},{"url":"https://lists.debian.org/debian-lts-announce/2024/12/msg00000.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T21:50:55.091Z"}}]}}}