{"answers":{"affected":"3 open source packages ship an affected version, including libpython, python and python-min. It affects 1 product.","exploited":"There is no known exploitation of CVE-2023-40217 in the wild and no public exploit code.","fix":"Upgrade libpython to a fixed version for your release line: 3.8.18, 3.9.18, 3.10.13 or 3.11.5.","what":"CVE-2023-40217 is a medium-severity vulnerability in Python Python, published on 25 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2023-40217 and fix it if it is affected.\n\nWhat it is: CVE-2023-40217 is a medium-severity vulnerability in Python Python, published on 25 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2023-40217 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- libpython (Bitnami): affected all versions; fixed in 3.8.18, 3.9.18, 3.10.13, 3.11.5\n- python (Bitnami): affected all versions; fixed in 3.8.18, 3.9.18, 3.10.13, 3.11.5\n- python-min (Bitnami): affected all versions; fixed in 3.8.18, 3.9.18, 3.10.13, 3.11.5\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-40217/ (Markdown: https://insights.sbomify.com/CVE-2023-40217/index.md)","id":"CVE-2023-40217","markdown":"https://insights.sbomify.com/CVE-2023-40217/index.md","name":"CVE-2023-40217","record":{"aliases":["ALPINE-CVE-2023-40217","ALSA-2023:5456","ALSA-2023:5462","ALSA-2023:5463","ALSA-2023:5994","ALSA-2023:5997","ALSA-2023:5998","AZL-109668","AZL-31170","BIT-libpython-2023-40217","BIT-python-2023-40217","BIT-python-min-2023-40217","CLEANSTART-2026-HA84441","CLSA-2023-1701971229","CLSA-2023-1701971295","CLSA-2023-1701971396","CLSA-2023-1701971558","CLSA-2024-1705079922","CLSA-2024-1705080095","DEBIAN-CVE-2023-40217","GHSA-4j9r-82g6-9mj3","OESA-2023-1677","PSF-2023-8","RHSA-2023:5456","RHSA-2023:5462","RHSA-2023:5463","RHSA-2023:5472","RHSA-2023:5528","RHSA-2023:5531","RHSA-2023:5990","RHSA-2023:5991","RHSA-2023:5992","RHSA-2023:5993","RHSA-2023:5994","RHSA-2023:5995","RHSA-2023:5996","RHSA-2023:5997","RHSA-2023:5998","RHSA-2023:6068","RHSA-2023:6069","RHSA-2023:6290","RHSA-2023:6823","RHSA-2023:6885","RLSA-2023:5463","RLSA-2023:5994","RLSA-2023:5997","RLSA-2023:5998","SUSE-SU-2023:3708-1","SUSE-SU-2023:3730-1","SUSE-SU-2023:3731-1","SUSE-SU-2023:3804-1","SUSE-SU-2023:3824-1","SUSE-SU-2023:3828-1","SUSE-SU-2023:3828-2","SUSE-SU-2023:3933-1","UBUNTU-CVE-2023-40217","USN-6513-2","openSUSE-SU-2024:13193-1","openSUSE-SU-2024:13201-1","openSUSE-SU-2024:13215-1","openSUSE-SU-2024:13219-1","openSUSE-SU-2024:13236-1","openSUSE-SU-2024:13248-1","openSUSE-SU-2024:13890-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"yes","non_default_config":true,"product_category":"Python standard library","requires_auth":"none","summary":"Attackers can bypass TLS client certificate authentication on Python servers by exploiting a race condition in socket closure, allowing unauthenticated data access.","user_interaction":"not_required","vuln_class":"security_feature_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"mitre","cpe":[{"product":"python","vendor":"python"}],"cvss":{"score":5.3,"severity":"medium","source":"nvd","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","version":"3.1"},"cwes":[],"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.)","ecosystems":["AlmaLinux:8","AlmaLinux:9","Bitnami","Red Hat:enterprise_linux:7::client","Red Hat:enterprise_linux:7::computenode","Red Hat:enterprise_linux:7::server","Red Hat:enterprise_linux:7::workstation","Red Hat:enterprise_linux:8::appstream","Red Hat:enterprise_linux:8::baseos","Red Hat:enterprise_linux:8::crb","Red Hat:enterprise_linux:9::appstream","Red Hat:enterprise_linux:9::baseos","Red Hat:enterprise_linux:9::crb","Red Hat:rhel_aus:8.2::appstream","Red Hat:rhel_aus:8.2::baseos","Red Hat:rhel_aus:8.4::appstream","Red Hat:rhel_aus:8.4::baseos","Red Hat:rhel_e4s:8.1::appstream","Red Hat:rhel_e4s:8.1::baseos","Red Hat:rhel_e4s:8.2::appstream","Red Hat:rhel_e4s:8.2::baseos","Red Hat:rhel_e4s:8.4::appstream","Red Hat:rhel_e4s:8.4::baseos","Red Hat:rhel_els:6","Red Hat:rhel_eus:8.6::appstream","Red Hat:rhel_eus:8.6::baseos","Red Hat:rhel_eus:8.6::crb","Red Hat:rhel_eus:9.0::appstream","Red Hat:rhel_eus:9.0::baseos","Red Hat:rhel_eus:9.0::crb","Red Hat:rhel_tus:8.2::appstream","Red Hat:rhel_tus:8.2::baseos","Red Hat:rhel_tus:8.4::appstream","Red Hat:rhel_tus:8.4::baseos","Rocky Linux:8","SUSE:Enterprise Storage 7.1","SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS","SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS","SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS","SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS","SUSE:Linux Enterprise Micro 5.1","SUSE:Linux Enterprise Micro 5.2","SUSE:Linux Enterprise Micro 5.3","SUSE:Linux Enterprise Micro 5.4","SUSE:Linux Enterprise Micro 5.5","SUSE:Linux Enterprise Module for Basesystem 15 SP4","SUSE:Linux Enterprise Module for Basesystem 15 SP5","SUSE:Linux Enterprise Module for Development Tools 15 SP4","SUSE:Linux Enterprise Module for Development Tools 15 SP5","SUSE:Linux Enterprise Module for Package Hub 15 SP4","SUSE:Linux Enterprise Module for Package Hub 15 SP5","SUSE:Linux Enterprise Module for Python 3 15 SP4","SUSE:Linux Enterprise Server 12 SP5","SUSE:Linux Enterprise Server 15 SP1-LTSS","SUSE:Linux Enterprise Server 15 SP2-LTSS","SUSE:Linux Enterprise Server 15 SP3-LTSS","SUSE:Linux Enterprise Server for SAP Applications 12 SP5","SUSE:Linux Enterprise Server for SAP Applications 15 SP1","SUSE:Linux Enterprise Server for SAP Applications 15 SP2","SUSE:Linux Enterprise Server for SAP Applications 15 SP3","SUSE:Linux Enterprise Software Development Kit 12 SP5","SUSE:Linux Enterprise Workstation Extension 12 SP5","SUSE:Manager Proxy 4.2","SUSE:Manager Server 4.2","openSUSE:Leap 15.4","openSUSE:Leap 15.5","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Security feature bypass in n/a","id":"CVE-2023-40217","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Bitnami","product":"python:python","products":["python:python"],"type":"security_feature_bypass","year":"2023"},"n_packages":2167,"n_references":5,"next":{"headline":"Integer overflow in n/a","id":"CVE-2023-40218"},"packages":[{"ecosystem":"Bitnami","fixed":["3.8.18","3.9.18","3.10.13","3.11.5"],"introduced":["0","3.9.0","3.10.0","3.11.0"],"last_affected":[],"package":"libpython","purl":"pkg:bitnami/libpython","source":"BIT-libpython-2023-40217"},{"ecosystem":"Bitnami","fixed":["3.8.18","3.9.18","3.10.13","3.11.5"],"introduced":["0","3.9.0","3.10.0","3.11.0"],"last_affected":[],"package":"python","purl":"pkg:bitnami/python","source":"BIT-python-2023-40217"},{"ecosystem":"Bitnami","fixed":["3.8.18","3.9.18","3.10.13","3.11.5"],"introduced":["0","3.9.0","3.10.0","3.11.0"],"last_affected":[],"package":"python-min","purl":"pkg:bitnami/python-min","source":"BIT-python-min-2023-40217"},{"ecosystem":"AlmaLinux:8","fixed":["2.5.1-10.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"babel","purl":"pkg:rpm/almalinux/babel","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["3.6.8-51.el8_8.2.alma.1"],"introduced":["0"],"last_affected":[],"package":"platform-python","purl":"pkg:rpm/almalinux/platform-python","source":"ALSA-2023:5997"},{"ecosystem":"AlmaLinux:8","fixed":["3.6.8-51.el8_8.2.alma.1"],"introduced":["0"],"last_affected":[],"package":"platform-python-debug","purl":"pkg:rpm/almalinux/platform-python-debug","source":"ALSA-2023:5997"},{"ecosystem":"AlmaLinux:8","fixed":["3.6.8-51.el8_8.2.alma.1"],"introduced":["0"],"last_affected":[],"package":"platform-python-devel","purl":"pkg:rpm/almalinux/platform-python-devel","source":"ALSA-2023:5997"},{"ecosystem":"AlmaLinux:8","fixed":["1.3.7-31.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python-nose-docs","purl":"pkg:rpm/almalinux/python-nose-docs","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["2.7.5-7.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python-psycopg2-doc","purl":"pkg:rpm/almalinux/python-psycopg2-doc","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["2.7.5-7.module_el8.6.0+3162+01a09e5a"],"introduced":["0"],"last_affected":[],"package":"python-psycopg2-doc","purl":"pkg:rpm/almalinux/python-psycopg2-doc","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["1.3.2-2.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python-sqlalchemy-doc","purl":"pkg:rpm/almalinux/python-sqlalchemy-doc","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["2.7.18-13.module_el8.8.0+3663+627ce7bb.2.alma.1"],"introduced":["0"],"last_affected":[],"package":"python2","purl":"pkg:rpm/almalinux/python2","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["0.28.1-7.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-Cython","purl":"pkg:rpm/almalinux/python2-Cython","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["0.28.1-7.module_el8.6.0+3162+01a09e5a"],"introduced":["0"],"last_affected":[],"package":"python2-Cython","purl":"pkg:rpm/almalinux/python2-Cython","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["0.8.0-10.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-PyMySQL","purl":"pkg:rpm/almalinux/python2-PyMySQL","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["17.4.0-10.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-attrs","purl":"pkg:rpm/almalinux/python2-attrs","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["2.5.1-10.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-babel","purl":"pkg:rpm/almalinux/python2-babel","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["1.0-16.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-backports","purl":"pkg:rpm/almalinux/python2-backports","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["1.0-16.module_el8.6.0+3162+01a09e5a"],"introduced":["0"],"last_affected":[],"package":"python2-backports","purl":"pkg:rpm/almalinux/python2-backports","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["3.5.0.1-12.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-backports-ssl_match_hostname","purl":"pkg:rpm/almalinux/python2-backports-ssl_match_hostname","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["3.7.0-1.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-bson","purl":"pkg:rpm/almalinux/python2-bson","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["3.7.0-1.module_el8.6.0+3162+01a09e5a"],"introduced":["0"],"last_affected":[],"package":"python2-bson","purl":"pkg:rpm/almalinux/python2-bson","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["3.0.4-10.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-chardet","purl":"pkg:rpm/almalinux/python2-chardet","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["4.5.1-4.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-coverage","purl":"pkg:rpm/almalinux/python2-coverage","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["4.5.1-4.module_el8.6.0+3162+01a09e5a"],"introduced":["0"],"last_affected":[],"package":"python2-coverage","purl":"pkg:rpm/almalinux/python2-coverage","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["2.7.18-13.module_el8.8.0+3663+627ce7bb.2.alma.1"],"introduced":["0"],"last_affected":[],"package":"python2-debug","purl":"pkg:rpm/almalinux/python2-debug","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["2.7.18-13.module_el8.8.0+3663+627ce7bb.2.alma.1"],"introduced":["0"],"last_affected":[],"package":"python2-devel","purl":"pkg:rpm/almalinux/python2-devel","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["1.15.0-10.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-dns","purl":"pkg:rpm/almalinux/python2-dns","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["2.7.16-2.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-docs","purl":"pkg:rpm/almalinux/python2-docs","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["2.7.16-2.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-docs-info","purl":"pkg:rpm/almalinux/python2-docs-info","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["0.14-12.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-docutils","purl":"pkg:rpm/almalinux/python2-docutils","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["1.0.2-13.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-funcsigs","purl":"pkg:rpm/almalinux/python2-funcsigs","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["2.5-7.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-idna","purl":"pkg:rpm/almalinux/python2-idna","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["1.0.18-6.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-ipaddress","purl":"pkg:rpm/almalinux/python2-ipaddress","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["2.10-9.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-jinja2","purl":"pkg:rpm/almalinux/python2-jinja2","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["2.7.18-13.module_el8.8.0+3663+627ce7bb.2.alma.1"],"introduced":["0"],"last_affected":[],"package":"python2-libs","purl":"pkg:rpm/almalinux/python2-libs","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["4.2.3-6.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-lxml","purl":"pkg:rpm/almalinux/python2-lxml","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["4.2.3-6.module_el8.6.0+3162+01a09e5a"],"introduced":["0"],"last_affected":[],"package":"python2-lxml","purl":"pkg:rpm/almalinux/python2-lxml","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["0.23-19.module_el8.6.0+2781+fed64c13"],"introduced":["0"],"last_affected":[],"package":"python2-markupsafe","purl":"pkg:rpm/almalinux/python2-markupsafe","source":"ALSA-2023:5994"},{"ecosystem":"AlmaLinux:8","fixed":["0.23-19.module_el8.6.0+3162+01a09e5a"],"introduced":["0"],"last_affected":[],"package":"python2-markupsafe","purl":"pkg:rpm/almalinux/python2-markupsafe","source":"ALSA-2023:5994"}],"prev":{"headline":"Denial of service in n/a","id":"CVE-2023-40216"},"products":["n/a"],"published":"2023-08-25","related":[{"cvss_score":10,"headline":"Integer overflow in n/a","id":"CVE-2008-5031","kev_date_added":null,"published":"2008-11-10"},{"cvss_score":9.8,"headline":"Path traversal in n/a","id":"CVE-2014-4650","kev_date_added":null,"published":"2020-02-20"},{"cvss_score":9.8,"headline":"Integer overflow in n/a","id":"CVE-2016-5636","kev_date_added":null,"published":"2016-09-02"},{"cvss_score":9.8,"headline":"Path traversal in n/a","id":"CVE-2007-4559","kev_date_added":null,"published":"2007-08-28"},{"cvss_score":8.8,"headline":"Command injection in n/a","id":"CVE-2017-17522","kev_date_added":null,"published":"2017-12-14"},{"cvss_score":8.7,"headline":"Incremental HTMLParser feed() allows CPU-exhaustion DoS via repeated unterminated markup declarations","id":"CVE-2026-15308","kev_date_added":null,"published":"2026-07-09"},{"cvss_score":7.8,"headline":"Privilege escalation in n/a","id":"CVE-2019-13404","kev_date_added":null,"published":"2019-07-08"}],"sources":[{"class":"attribution","licence":"MIT","name":"AlmaLinux","prefix":"ALSA"},{"class":"attribution","licence":"Apache-2.0","name":"Bitnami","prefix":"BIT"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-11-03","vendors":["n/a"]},"summary":"Attackers can bypass TLS client certificate authentication on Python servers by exploiting a race condition in socket closure, allowing unauthenticated data access.","url":"https://insights.sbomify.com/CVE-2023-40217/"}