BIT-python-min-2024-0397: Memory race condition in ssl.SSLContext certificate store methods

Published Jun 17, 2024
·
Updated

A defect was discovered in the Python “ssl” module where there is a memory race condition with the ssl.SSLContext methods “certstorestats()” and “getcacerts()”. 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.

Affected Software

1 affected component
Python Software Foundation CPython<3.10.14, <3.11.9, <3.12.3, <3.13.0a5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade CPython to a version that resolves this vulnerability.

    Fixed in 3.10.14
  2. Upgrade

    Upgrade CPython to a version that resolves this vulnerability.

    Fixed in 3.11.9
  3. Upgrade

    Upgrade CPython to a version that resolves this vulnerability.

    Fixed in 3.12.3
  4. Upgrade

    Upgrade CPython to a version that resolves this vulnerability.

    Fixed in 3.13.0a5

Event History

Jun 17, 2024
CVE Published
via OSV·03:09 PM
Data Sourced
via OSV·03:09 PM
DescriptionSeverity

Frequently Asked Questions

1

What conditions are required to trigger this issue?

The race requires cert_store_stats() or get_ca_certs() to run concurrently with certificate loading into the same ssl.SSLContext. One described scenario is certificate loading during a TLS handshake when a certificate directory is configured.

2

Which CPython releases contain the fix?

The issue is fixed in CPython 3.10.14, 3.11.9, 3.12.3, and 3.13.0a5.

3

Are applications that do not inspect the SSLContext certificate store during certificate loading affected?

The described trigger depends on concurrent calls to cert_store_stats() or get_ca_certs() while certificates are being loaded into the SSLContext. Applications that do not create that concurrency do not match the stated trigger condition.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203