CVE-2024-5642

NameCVE-2024-5642
DescriptionCPython 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).
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
pypy3 (PTS)bullseye7.3.5+dfsg-2+deb11u2vulnerable
bullseye (security)7.3.5+dfsg-2+deb11u4vulnerable
bookworm7.3.11+dfsg-2+deb12u3fixed
sid, trixie7.3.19+dfsg-1fixed
python2.7 (PTS)bullseye2.7.18-8+deb11u1vulnerable
python3.11 (PTS)bookworm3.11.2-6+deb12u5fixed
bookworm (security)3.11.2-6+deb12u3fixed
python3.12 (PTS)sid3.12.9-1fixed
python3.13 (PTS)trixie3.13.2-2fixed
sid3.13.2-3fixed
python3.9 (PTS)bullseye3.9.2-1vulnerable
bullseye (security)3.9.2-1+deb11u3vulnerable

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
pypy3source(unstable)7.3.10+dfsg-1
python2.7source(unstable)(unfixed)
python3.11source(unstable)(not affected)
python3.12source(unstable)(not affected)
python3.13source(unstable)(not affected)
python3.7source(unstable)(unfixed)
python3.9source(unstable)(unfixed)

Notes

[bullseye] - pypy3 <postponed> (Minor issue, infoleak in unlikely scenario)
- python3.13 <not-affected> (Fixed before initial upload)
- python3.12 <not-affected> (Fixed before initial upload)
- python3.11 <not-affected> (Fixed before initial upload)
[bullseye] - python3.9 <ignored> (NPN support already disabled in Python with OpenSSL 1.1.1)
[bullseye] - python2.7 <ignored> (Unsupported in Bullseye, only included to build a few applications)
https://jbp.io/2024/06/27/cve-2024-5535-openssl-memory-safety.html
https://github.com/python/cpython/pull/23014
https://mail.python.org/archives/list/security-announce@python.org/thread/PLP2JI3PJY33YG6P5BZYSSNU66HASXBQ/
Fixed by removing or disabling NPN support.
Python NPN code expunged in v3.10:
https://github.com/python/cpython/commit/39258d3595300bc7b952854c915f63ae2d4b9c3e (v3.10.0b1)
Python NPN support (ssl.HAS_NPN) previously disabled at compile-time if OpenSSL >= 1.1.1 (>= buster) is detected:
https://github.com/python/cpython/commit/a79591cfb81dde65bb2f891d62de0161c23a4ff4 (v3.6.5rc1)
https://github.com/python/cpython/commit/df1732a4734190fefc8814687895fc1168716c37 (v2.7.15rc1)
PyPy NPN is dead code starting with pypy3.9 v7.3.8rc1 / pypy3.10 v7.3.12rc1 / pypy3.11 v7.3.18:
https://github.com/pypy/pypy/commit/6b731c86269cadbafc70a7436996115a8cd312ff (release-pypy3.9-v7.3.8rc1)

Search for package or bug name: Reporting problems