Memory race condition in ssl.SSLContext certificate store methods
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- —
- Confidentiality · integrity · availability
- High · None · High
- Fix status
- Partial Red Hat: 3 fixed, 3 without a fix
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA and Red Hat.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Python Software Foundation | CPython | 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 | 3.8.20, 3.9.20, 3.10.14, 3.11.9, 3.12.3, 3.13.0a5 | Patch available | CNA |
- CPython VendorPython Software Foundation 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 Patch available CNA
CPE names CISA-ADP · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:python_software_foundation:cpython:*:*:*:*:*:*:*:* | — | — | Python Software Foundation |
- cpe:2.3:a:python_software_foundation:cpython:*:*:*:*:*:*:*:* Versions — — ·Python Software Foundation
Remediation
- Fix · CNA CPython (Python Software Foundation) Fixed in 3.8.20, 3.9.20, 3.10.14, 3.11.9, 3.12.3, 3.13.0a5
Red Hat 3 advisories
- RHSA-2024:10983 Released 2024-12-12 · Red Hat rating Moderatepython3.9:3.9.21 security update
- Red Hat CodeReady Linux Builder (v. 9) python3-3.9.21-1.el9_5, python3-debug-3.9.21-1.el9_5, python3-idle-3.9.21-1.el9_5 +2
- Red Hat Enterprise Linux AppStream (v. 9) python-unversioned-command-3.9.21-1.el9_5, python3-devel-3.9.21-1.el9_5, python3-tkinter-3.9.21-1.el9_5
- Red Hat Enterprise Linux BaseOS (v. 9) python3-3.9.21-1.el9_5, python3-libs-3.9.21-1.el9_5, python3.9-3.9.21-1.el9_5
- RHSA-2024:9190 Released 2024-11-12 · Red Hat rating Moderatepython3.12 security update
- Red Hat CodeReady Linux Builder (v. 9) python3.12-3.12.5-2.el9, python3.12-debug-3.12.5-2.el9, python3.12-idle-3.12.5-2.el9 +2
- Red Hat Enterprise Linux AppStream (v. 9) python3.12-3.12.5-2.el9, python3.12-devel-3.12.5-2.el9, python3.12-libs-3.12.5-2.el9 +1
- RHSA-2024:9192 Released 2024-11-12 · Red Hat rating Moderatepython3.11 security update
- Red Hat CodeReady Linux Builder (v. 9) python3.11-3.11.9-7.el9, python3.11-debug-3.11.9-7.el9, python3.11-idle-3.11.9-7.el9 +2
- Red Hat Enterprise Linux AppStream (v. 9) python3.11-3.11.9-7.el9, python3.11-devel-3.11.9-7.el9, python3.11-libs-3.11.9-7.el9 +1
Vendor assessments
Red Hat
Red Hat rating: Low. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 8 | Affected | No fix planned: Out of support scope |
| Red Hat CodeReady Linux Builder (v. 9) | Fixed | RHSA-2024:10983, RHSA-2024:9190, RHSA-2024:9192 |
| Red Hat Enterprise Linux AppStream (v. 9) | Fixed | RHSA-2024:10983, RHSA-2024:9190, RHSA-2024:9192 |
| Red Hat Enterprise Linux BaseOS (v. 9) | Fixed | RHSA-2024:10983 |
Not affected: 1 product
- Red Hat Enterprise Linux 10
Timeline
- 2026-10-02 Threatist record created from CVE-2024-0397
- 2026-10-03 Alias added: GHSA-xhf3-pp4q-gxh5
References
Patch 7
- https://github.com/python/cpython/pull/114573
- 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
Advisory 1
More Python Software Foundation vulnerabilities
- TI-2024-07037 Quadratic complexity parsing cookies with backslashes CVSS 3.1HIGH 7.5
- TI-2024-11791 Bypass extraction filter to modify file metadata outside extraction directory CVSS 3.1MEDIUM 5.3
- TI-2024-00411 Quoted zip-bomb protection for zipfile CVSS 3.1MEDIUM 6.2
- TI-2026-13296 `HTTPPasswordMgr` can send saved HTTPS credentials via HTTP because of incorrect scheme matching CVSS 4.0MEDIUM 6.0
- TI-2024-06422 Email header injection due to unquoted newlines CVSS 3.1MEDIUM 5.5
- TI-2026-04606 Possible to hijack modules in current working directory CVSS 4.0MEDIUM 5.6
Sources
- CVE-2024-0397 · CVE Program
- CVE-2024-0397 · NVD
- FIRST EPSS
- GHSA-xhf3-pp4q-gxh5 · GitHub Advisory Database · CC BY 4.0
- CVE-2024-0397 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences