# CVE-2024-5642: Buffer overread when using an empty list with SSLContext.set_npn_protocols()

- Severity: Medium 6.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L`
- 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): 1.23%, higher than 69% of CVEs (2026-11-30)
- Published: 2024-06-27T21:05:31.281Z
- Modified: 2026-07-31T15:16:26.997Z
- Also known as: PSF-2024-6, BIT-LIBPYTHON-2024-5642, BIT-PYTHON-2024-5642, BIT-PYTHON-MIN-2024-5642
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: PSF

## Description

CPython 3.9 and earlier doesn't disallow configuring an empty list ("[]") for SSLContext.set_npn_protocols() which is an invalid value for the underlying OpenSSL API. This results in a buffer over-read when NPN is used (see CVE-2024-5535 for OpenSSL). This vulnerability is of low severity due to NPN being not widely used and specifying an empty list likely being uncommon in-practice (typically a protocol name would be configured).

(As written by CVE List.)

## Affected

- Python Software Foundation CPython: before 3.9.24; from 3.10.0a1 before 3.10.0b1
- https://github.com/python/cpython: before 39258d3595300bc7b952854c915f63ae2d4b9c3e; before a2cdbb6e8188ba9ba8b356b28d91bff60e86fe31
- libpython (Bitnami): before 3.9.24
- python (Bitnami): before 3.9.24
- python-min (Bitnami): before 3.9.24

## Every score

- CISA-ADP: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://jbp.io/2024/06/27/cve-2024-5535-openssl-memory-safety.html> (third-party-advisory, web)
- <https://github.com/python/cpython/pull/23014> (mitigation, web)
- <https://mail.python.org/archives/list/security-announce@python.org/thread/PLP2JI3PJY33YG6P5BZYSSNU66HASXBQ/> (advisory, vendor-advisory, web)
- <https://github.com/python/cpython/commit/39258d3595300bc7b952854c915f63ae2d4b9c3e> (fix, patch, web)
- <http://www.openwall.com/lists/oss-security/2024/06/28/4> (web)
- <https://github.com/python/cpython/issues/121227> (issue-tracking, report, web)
- <https://security.netapp.com/advisory/ntap-20240726-0005/> (web)
- <https://github.com/python/cpython/commit/a2cdbb6e8188ba9ba8b356b28d91bff60e86fe31> (fix, patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-5642> (web)

## Sources

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

---

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