Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessGain MITM position on TLS path
-
DeliveryPresent CA-trusted cert for wrong hostname
-
Exploitssl.get_server_certificate skips hostname check
-
ExecutionCaller trusts impersonated server
-
ImpactSession data exposed or spoofed
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V12 - Secure Communication Certificate validation
|
| Exploitation Conditions | Exploitation is limited to applications that call ssl.get_server_certificate() with the ca_certs parameter set - the vulnerable branch; calls without ca_certs are unaffected, and the pre-fix behavior only validated the chain, not the hostname. A successful attack additionally requires (1) an active man-in-the-middle position on the TLS connection between client and target, and (2) a certificate that validates against the caller-supplied ca_certs trust store but is issued for a hostname other than the intended server. These constraints - narrow API usage plus required interception and a trust-chaining certificate - substantially limit realistic exploitation beyond what AV:N/AC:L would suggest. The fix makes the function raise SSLCertVerificationError on hostname mismatch when ca_certs is specified; the available sources name no separate mitigation, so updating is the remedy. |
| Impact | This is a certificate-identity (hostname) verification flaw in CPython's ssl.get_server_certificate(): when ca_certs is supplied the server certificate was validated for trust-chain but its hostname was never checked against the connection target (improper certificate validation, consistent with the 'Information Disclosure' tag and CWE-295-class behavior). The supplied CVSS:4.0 vector is network/low-complexity/no-privilege/no-UI but reports ALL impact metrics as N (VC:N/VI:N/VA:N) - an all-zero impact string that is internally inconsistent with a disclosed vulnerability and aligns with the 'awaiting_data' priority label, so it should be treated as a placeholder rather than a real severity signal, not as evidence of zero impact. There is no CISA KEV listing, no EPSS score provided, and no exploit/PoC reference in the input (only a patch PR, the issue tracker entry, and a PSF advisory), so exploitation signals are absent. Real-world risk is LOW-to-MODERATE despite the ubiquity of CPython: the flaw only matters to code that explicitly calls ssl.get_server_certificate() with ca_certs expecting full validation, and exploitation requires an active man-in-the-middle position plus a certificate that chains to the caller's trust store - this is a correctness/assurance weakness enabling MITM impersonation, not a mass-exploitable remote code execution issue. Key missing data: no EPSS, no independent CVSS from NVD, and the input CVSS 4.0 impact metrics conflict with the vulnerability class - verify severity with PSF rather than relying on the all-N vector. |
| Exploit ScenarioDerived | An attacker positioned to intercept TLS traffic (MITM) presents a certificate that validates against the caller-supplied ca_certs trust store but was issued for a different hostname; a Python application calling ssl.get_server_certificate((host, port), ca_certs=...) accepts and returns that certificate without detecting the hostname mismatch, so the application trusts a server it is not actually talking to. No public exploit code is identified in the provided sources; the attack depends on holding a network interception position and possessing a certificate that chains to the trusted CA(s) the caller supplied. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 09, 2026
Certificate hostname verification is missing in CPython's ssl.get_server_certificate(): when a caller supplies the ca_certs argument, the retrieved server certificate is validated against that trust store but its hostname is never compared to the host being connected to, so a certificate issued for a different name is accepted. Only code paths that pass ca_certs are exposed; a successful attack additionally requires an active man-in-the-middle position on the TLS connection and a certificate that chains to the caller-supplied CA bundle yet names another host, which substantially narrows realistic exploitation. No public exploit code was identified at time of analysis, and an upstream fix makes the function raise SSLCertVerificationError on hostname mismatch.
RemediationAI
Upstream fix available (PR/commit); released patched version not independently confirmed. Update CPython to a release that includes https://github.com/python/cpython/pull/161507, after which ssl.get_server_certificate() raises SSLCertVerificationError when ca_certs is supplied and the presented certificate's hostname does not match the server hostname; consult https://mail.python.org/archives/list/security-announce@python.org/thread/SXBD6BGHDBTGM4KSUMQEWYIQ5RO4BQ76/ and https://github.com/python/cpython/issues/161503 for the vendor's guidance on which builds carry the change, as the available data names no fixed version numbers. Until a patched interpreter is deployed, note that only call sites passing ca_certs are on the vulnerable branch, while the sources reviewed name no separate mitigation and describe updating as the remedy; verify certificate identity out of band wherever custom trust stores are used with this helper until the upgrade lands.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
ssl.get_server_certificate() opens a TLS connection to a host:port and returns the peer certificate as PEM. Its optional ca_certs parameter loads a caller-chosen trust store, but prior to the fix the internal SSLContext performed chain validation only and did not enable hostname checking (check_hostname), so the identity binding between the certificate subject/SANs and the connection target was never enforced - behavior in the improper-certificate-validation class (CWE-295-class, consistent with the Information Disclosure tag). The upstream change in PR 161507 adds check_hostname=ca_certs is not None to the context construction, updates the Doc/library/ssl.rst text to state that an SSLCertVerificationError is raised when ca_certs is specified and the certificate hostname does not match the server hostname, and adds test_get_server_certificate_fail_by_hostname plus a Misc/NEWS Security entry referencing this CVE. Calls that do not pass ca_certs take the unvalidated branch and are unaffected; the flaw is a validation-scope gap in one library helper rather than a break in the TLS stack itself.
Know when Cpython gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:N/SA:N
MITM position plus a certificate chaining to the supplied CA store makes AC:H; false validation assurance yields limited confidentiality impact (C:L), with no direct integrity or availability impact to the host.
Primary rating from Vendor (PSF).
CVSS VectorVendor: PSF
DescriptionCVE.org
When ca_certs parameter was supplied to ssl.get_server_certificate() function, the identity of the certificate is not checked.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Integrity bypass in CPython's stringprep module causes divergent domain name normalization when processing international
CPython's ssl module validates TLS certificate chains that anchor to known-compromised eMudhra CA certificates, so anyon
A use-after-free in CPython's ssl module lets a remote, unauthenticated TLS client crash a Python TLS server process - o
CPython decompression modules (lzma, bz2, gzip) allow memory corruption via use-after-free when decompressor instances a
Out-of-bounds buffer write in CPython's asyncio.ProactorEventLoop (Windows only) allows remote attackers to trigger memo
Denial of service in CPython's tarfile module allows remote attackers to trigger an infinite loop by supplying a crafted
Stack-based buffer overflow in CPython's bz2.BZ2Decompressor allows remote attackers to crash Python applications by sen
FIPS algorithm enforcement in CPython 3.14.10's hashlib module can fail for hash requests made with usedforsecurity=True
Path traversal in CPython's tarfile module allows a crafted tar archive to bypass the 'data' and 'tar' extraction filter
Certificate hostname verification is silently skipped in CPython's TLS stack when an application enables SSLContext.chec
Command injection in CPython's webbrowser.open() API bypasses previous CVE-2026-4519 mitigation via specially crafted UR
The webbrowser.open() API in CPython accepts URLs with leading dashes, which certain web browsers interpret as command-l
EUVD-2026-120066
GHSA-hrvr-m27m-jc99
NVD
CVE.org
EPSS
VulDB
Exploit-DB