// Security Advisory Triage

CPython ssl.SSLContext.wrap_bio() skips hostname verification when server_hostname is None

Python security announcements · published 2026-09-30 22:01 UTC
ACTION NEEDED MITIGATE SECURITYAPI
WHAT CHANGEDCVE-2026-19553 disclosed 30 September 2026. ssl.SSLContext.wrap_bio() does not raise ValueError when server_hostname is None and check_hostname is True, causing hostname verification to be silently skipped. The same defect affects asyncio.create_connection() and asyncio.loop.start_tls(). Rated HIGH severity.
WHY IT MATTERSServices using these APIs with check_hostname enabled but without passing server_hostname accept any certificate, defeating TLS hostname verification. The misconfiguration produces no error, so affected code appears to be validating certificates when it is not. This allows man-in-the-middle attacks against what looks like properly configured TLS.
WHAT TO DOAudit calls to ssl.SSLContext.wrap_bio(), asyncio.create_connection(), and asyncio.loop.start_tls() in your Python codebases. Confirm every call passes a non-None, non-empty server_hostname argument. If any call omits it or passes None, add the correct hostname immediately — this fixes the vulnerability without patching Python. Then apply the Python patch when available to convert silent failures into ValueErrors.
Model-reported confidence 95% (not measured accuracy) Primary source ↗ written by anthropic/claude-sonnet-4.5
Show the reasoning — raw diff, triage verdict, confidence
RAW DIFF
+## [Security-announce][CVE-2026-19553] SSLContext.wrap_bio() missing validation of server_hostname parameter
+https://mail.python.org/archives/list/security-announce@python.org/message/QNZRG3YOAMTHDCMVCICXGY6YEFPY2VDL/
+Wed, 30 Sep 2026 16:08:09 +0000
+
+There is a HIGH severity vulnerability affecting CPython.
+
+`ssl.SSLContext.wrap_bio()` didn't require the `server_hostname` argument
+to not be `None` if `ssl.SSLContext.check_hostname` was set. Due to a
+missing parameter check in `SSLObject`, if the `server_hostname` argument
+isn't supplied then hostname verification would be silently skipped.
+
+This defect could lead to programs where certificate hostname verification
+*appeared* to be succeeding with `SSLContext.check_hostname = True` and no
+`ValueError` being raised due to misconfiguration.
+
+If the program passes a `server_hostname` value that isn't an empty string
+or `None` to any of these APIs then certificate hostname verification
+proceeds as expected and the program is not affected by this vulnerability.
+
+Mitigating this vulnerability doesn't require updating Python or applying
+the patch. To mitigate, pass a valid non-`None` and non-empty
+`server_hostname` value to `SSLContext.wrap_bio()`,
+`asyncio.create_connection()`, or `asyncio.loop.start_tls()` and
+certificate hostname verification will proceed as expected. Upgrading to
+the latest version of Python or applying the patch only changes the
+behavior from silently skipping hostname verification to raising a
+`ValueError`, similar to `SSLContext.wrap_socket()`, when `server_hostname`
+isn't supplied.
+
+Please see the linked CVE ID for the latest information on affected
+versions:
+
+* https://www.cve.org/CVERecord?id=CVE-2026-19553
+* https://github.com/python/cpython/pull/158503
HOW IT WAS JUDGED
Triage signals below are model-reported assertions, preserved verbatim; they are not independent arithmetic verification.
triage verdictMATERIAL at 0.95, needed 0.5
triage reasoningPython SSL hostname verification bypass affects runtime and standard library APIs in dependency trees.
signalsaffects Python runtime (CPython) · ssl.SSLContext.wrap_bio() — core cryptographic API · hostname verification silently skipped under misconfiguration · HIGH severity rating · affects asyncio APIs used in normal services · security-announce channel — official Python security advisory
suppression—
triage modelanthropic/claude-haiku-4.5 ($0.00000)
writer modelanthropic/claude-sonnet-4.5 ($0.00000)