CVE-2023-40217
CVE-2023-40217 is a medium-severity vulnerability in Python with a CVSS 3.x base score of 5.3. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low.
Key facts
- Severity: Medium (CVSS 3.x base score 5.3)
- EPSS exploit prediction: 1% (52nd percentile)
- Actively exploited: Not listed in CISA KEV
- Affected product: Python
- Published:
- Last modified:
Description
An issue was discovered in Python before 3.8.18, 3.9.x before 3.9.18, 3.10.x before 3.10.13, and 3.11.x before 3.11.5. It primarily affects servers (such as HTTP servers) that use TLS client authentication. If a TLS server-side socket is created, receives data into the socket buffer, and then is closed quickly, there is a brief window where the SSLSocket instance will detect the socket as "not connected" and won't initiate a handshake, but buffered data will still be readable from the socket buffer. This data will not be authenticated if the server-side TLS peer is expecting client certificate authentication, and is indistinguishable from valid TLS stream data. Data is limited in size to the amount that will fit in the buffer. (The TLS connection cannot directly be used for data exfiltration because the vulnerable code path requires that the connection be closed on initialization of the SSLSocket.)
Frequently asked questions
- What is CVE-2023-40217?
- An issue was discovered in Python before 3.8.18, 3.9.x before 3.9.18, 3.10.x before 3.10.13, and 3.11.x before 3.11.5. It primarily affects servers (such as HTTP servers) that use TLS client authentication. If a TLS server-side socket is created, receives data into the socket buffer, and then is closed quickly, there is a brief window where the SSLSocket instance will detect the socket as "not connected" and won't initiate a handshake, but buffered data will still be readable from the socket buffer. This data will not be authenticated if the server-side TLS peer is expecting client certificate authentication, and is indistinguishable from valid TLS stream data. Data is limited in size to the amount that will fit in the buffer. (The TLS connection cannot directly be used for data exfiltration because the vulnerable code path requires that the connection be closed on initialization of the SSLSocket.)
- How severe is CVE-2023-40217?
- CVE-2023-40217 has a CVSS 3.x base score of 5.3, rated medium severity. It is exploitable over network with low attack complexity, requires no privileges and no user interaction. Impact on confidentiality is low, integrity none, and availability none.
- Is CVE-2023-40217 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 1% (52nd percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2023-40217?
- CVE-2023-40217 affects Python. See the affected-products list for the exact vulnerable versions.
- How do I fix CVE-2023-40217?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround.
- When was CVE-2023-40217 published?
- CVE-2023-40217 was published on 2023-08-25 and last updated on 2026-06-17.
References
- https://lists.debian.org/debian-lts-announce/2023/09/msg00022.html
- https://lists.debian.org/debian-lts-announce/2023/10/msg00017.html
- https://mail.python.org/archives/list/security-announce%40python.org/thread/PEPLII27KYHLF4AK3ZQGKYNCRERG4YXY/
- https://security.netapp.com/advisory/ntap-20231006-0014/
- https://www.python.org/dev/security/
- https://lists.debian.org/debian-lts-announce/2024/11/msg00005.html
- https://lists.debian.org/debian-lts-announce/2024/12/msg00000.html
Affected products (1)
- cpe:2.3:a:python:python:*:*:*:*:*:*:*:*
More vulnerabilities in Python
- CVE-2008-5031 — Critical (CVSS 10.0): Multiple integer overflows in Python 2.2.3 through 2.5.1, and 2.6, allow context-dependent attackers to have an unknown…
- CVE-2022-48565 — Critical (CVSS 9.8): An XML External Entity (XXE) issue was discovered in Python through 3.9.1. The plistlib module no longer accepts entity…
- CVE-2022-37454 — Critical (CVSS 9.8): The Keccak XKCP SHA-3 reference implementation before fdc6fef has an integer overflow and resultant buffer overflow…
- CVE-2021-29921 — Critical (CVSS 9.8): In Python before 3,9,5, the ipaddress library mishandles leading zero characters in the octets of an IP address string.…
- CVE-2021-3177 — Critical (CVSS 9.8): Python 3.x through 3.9.1 has a buffer overflow in PyCArg_repr in _ctypes/callproc.c, which may lead to remote code…
- CVE-2020-27619 — Critical (CVSS 9.8): In Python 3 through 3.9.0, the Lib/test/multibytecodec_support.py CJK codec tests call eval() on content retrieved via…
Threat intelligence
Threat-intel indicators referencing this CVE:
- 49.229.102.187 (ipv4-addr)
- 203.192.232.180 (ipv4-addr)
- 177.53.215.134 (ipv4-addr)
- 141.109.168.26 (ipv4-addr)
- 141.109.168.107 (ipv4-addr)
- 125.212.235.194 (ipv4-addr)
- 120.28.109.188 (ipv4-addr)
- 144.22.150.242 (ipv4-addr)