CVE-2023-40217
NixOS vulnerability analysis and mitigation

Overview

CVE-2023-40217 is a vulnerability discovered in Python versions 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. The vulnerability primarily affects servers (such as HTTP servers) that use TLS client authentication (NVD). It was discovered and disclosed in August 2023, with patches released on August 24, 2023 (Python Security).

Technical details

The vulnerability occurs when a TLS server-side socket is created, receives data into the socket buffer, and is then closed quickly. In this scenario, there is a brief window where the SSLSocket instance detects the socket as 'not connected' and won't initiate a handshake, but buffered data remains readable from the socket buffer. This data bypasses authentication if the server-side TLS peer expects client certificate authentication, and is indistinguishable from valid TLS stream data (NVD). The vulnerability has been assigned a CVSS base score of 5.3 (MEDIUM) with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N (NetApp Advisory).

Impact

The vulnerability primarily impacts HTTPS servers and other server-side protocols using TLS client authentication (such as mTLS). While there is no risk of data exfiltration directly from the malicious TLS connection, the vulnerability does carry risk for modifying or deleting resources which are authenticated using only TLS client certificates. The vulnerability affects clients who read and process data from the server after a TLS handshake without sending data first (Python Security).

Mitigation and workarounds

The recommended mitigation is to upgrade to Python versions 3.11.5, 3.10.13, 3.9.18, or 3.8.18. Alternatively, users can add a call to SSLSocket.getpeername() after calling SSLSocket.wrap_socket() before any calls to SSLSocket.recv(). This call will raise an OSError if the socket isn't connected, thus mitigating the vulnerability (Python Security).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
David EstlickCISO
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
Adam FletcherChief Security Officer
“We know that if Wiz identifies something as critical, it actually is.”
Greg PoniatowskiHead of Threat and Vulnerability Management