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

Other sources

Memory race condition in ssl.SSLContext certificate store methods

— Microsoft

Affected Software

11 affected componentsFixes available
Microsoft azl3 python3 3.12.0-4
Microsoft azl3 python3 3.12.3-1
Microsoft cbl2 python3 3.9.19-13
Microsoft cbl2 python3 3.9.19-3
debian/pypy3*
debian/pypy3<7.3.16+dfsg-1
7.3.16+dfsg-1
debian/pypy3<7.3.16+dfsg-1
7.3.16+dfsg-1
debian/python3.11<3.11.2-6+deb12u3
3.11.2-6+deb12u3
debian/pypy3<=7.3.11+dfsg-2+deb12u3
7.3.19+dfsg-28.0.1+dfsg-1
debian/python3.11
3.11.2-6+deb12u83.11.2-6+deb12u9
debian/python3.13
3.13.5-2+deb13u53.13.18-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/pypy3 to a version that resolves this vulnerability.

    Fixed in 7.3.16+dfsg-1
  2. Upgrade

    Upgrade debian/python3.11 to a version that resolves this vulnerability.

    Fixed in 3.11.2-6+deb12u3
  3. Upgrade

    Upgrade debian/pypy3 to a version that resolves this vulnerability.

    Fixed in 7.3.19+dfsg-2Fixed in 8.0.1+dfsg-1
  4. Upgrade

    Upgrade debian/python3.11 to a version that resolves this vulnerability.

    Fixed in 3.11.2-6+deb12u8Fixed in 3.11.2-6+deb12u9
  5. Upgrade

    Upgrade debian/python3.13 to a version that resolves this vulnerability.

    Fixed in 3.13.5-2+deb13u5Fixed in 3.13.18-1
  6. Upgrade

    Upgrade CPython to a version that resolves this vulnerability.

    Fixed in 3.10.14
  7. Upgrade

    Upgrade CPython to a version that resolves this vulnerability.

    Fixed in 3.11.9
  8. Upgrade

    Upgrade CPython to a version that resolves this vulnerability.

    Fixed in 3.12.3
  9. Upgrade

    Upgrade CPython to a version that resolves this vulnerability.

    Fixed in 3.13.0a5

Event History

Jun 17, 2024
CVE Published
via MITRE·03:09 PM
Data Sourced
via MITRE·03:09 PM
Description
Data Sourced
via OSV·03:09 PM
DescriptionSeverity
Data Sourced
via NVD·04:15 PM
DescriptionSeverityWeakness
Data Sourced
via OSV·04:15 PM
Affected Software
Aug 5, 2024
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2024-0397?

CVE-2024-0397 is classified as a medium severity vulnerability due to the potential for a memory race condition.

2

What kind of issue does CVE-2024-0397 involve?

CVE-2024-0397 involves a memory race condition in the Python 'ssl' module affecting SSLContext methods.

3

How do I fix CVE-2024-0397?

To fix CVE-2024-0397, upgrade to Python versions 3.11.2-6+deb12u3, 3.12.6-1, or 3.13.0-1 or later.

4

Which Python versions are affected by CVE-2024-0397?

CVE-2024-0397 affects Python 2.7, and Python 3 versions up to 3.11.2-6+deb12u2, 3.9.2-1.

5

Are there any known exploit scenarios for CVE-2024-0397?

As of now, there are no publicly known exploit scenarios for CVE-2024-0397, but the race condition could lead to unpredictable behavior.

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