Skip to main content
No exploitation reportedFix available

CVE-2023-40217

No exploitation reported by the sources we read.

  • Published2023-08-25
  • Fixed in3.11.5 · 3.10.13 · 3.9.18 · 3.8.18

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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

Timeline

dates in UTC
  1. 2023-08-2501:15CVE publishedNVD

Versions per branch

NVD · OSV
Python
BranchAffectedFixed in
3.11≥ 3.11.0, < 3.11.53.11.5
3.10≥ 3.10.0, < 3.10.133.10.13
3.9≥ 3.9.0, < 3.9.183.9.18
3.8< 3.8.183.8.18

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • babelRocky Linux:8all versions · fixed in 0:2.5.1-10.module+el8.9.0+1531+a18208f5
  • babelRed Hat:rhel_aus:8.2::appstreamall versions · fixed in 0:2.5.1-9.module+el8.1.0+3111+de3f2d8eand 1 other package
  • babelRed Hat:enterprise_linux:8::appstreamall versions · fixed in 0:2.5.1-10.module+el8.5.0+11014+88fc0d0band 1 other package
  • babelAlmaLinux:8all versions · fixed in 2.5.1-10.module_el8.6.0+2781+fed64c13and 1 other package
  • CythonRocky Linux:8all versions · fixed in 0:0.28.1-7.module+el8.9.0+1531+a18208f5
  • CythonRocky Linux:8all versions · fixed in 0:0.29.21-5.module+el8.10.0+1582+bc278001
  • CythonRocky Linux:8all versions · fixed in 0:0.29.21-5.module+el8.10.0+1860+afcc1c71
  • CythonRed Hat:rhel_aus:8.2::appstreamall versions · fixed in 0:0.28.1-7.module+el8.1.0+3111+de3f2d8eand 3 other packages

451 more package ranges on OSV.dev

Vendor advisories

  • RHSA-2023:6793 Red Hat Product Security38 products fixed

    Red Hat Security Advisory: rh-python38-python security update

Full record on NVD

Fix

  1. Update Python to 3.11.5 · 3.10.13 · 3.9.18 · 3.8.18
  2. Vendor fix Red Hat Product Security RHSA-2023:6793 · 38 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258

Advisories and patches

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Published
2023-08-25
Last Modified
2026-06-17
NVD status
Modified
GitHub Advisory
GHSA-4j9r-82g6-9mj3

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

Is CVE-2023-40217 actively exploited?

Active exploitation of CVE-2023-40217 has not been confirmed. Its EPSS score was 0.8% on 2026-11-08, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2023-40217?

CVE-2023-40217 has a CVSS v3 base score of 5.3 (MEDIUM severity), with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.

Running Python? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record