BIT-python-2026-19553: SSLContext.wrap_bio() missing validation of server_hostname parameter

Published Sep 30, 2026
·
Updated

ssl.SSLContext.wrapbio() didn't require the serverhostname argument to not be None if ssl.SSLContext.checkhostname was set. Due to a missing parameter check in SSLObject, if the serverhostname 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.checkhostname = True and no ValueError being raised due to misconfiguration.

If the program passes a serverhostname 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 serverhostname value to SSLContext.wrapbio(), asyncio.createconnection(), or asyncio.loop.starttls() 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.wrapsocket(), when serverhostname isn't supplied.

Affected Software

1 affected component
Python Software Foundation Python

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    Pass a valid, non-None and non-empty server_hostname value to ssl.SSLContext.wrap_bio(), asyncio.create_connection(), or asyncio.loop.start_tls() so certificate hostname verification proceeds as expected.

Event History

Sep 30, 2026
CVE Published
via OSV·04:17 PM
Data Sourced
via OSV·04:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are affected?

Applications are affected only if they use SSLContext.wrap_bio(), asyncio.create_connection(), or asyncio.loop.start_tls() with SSLContext.check_hostname enabled and omit server_hostname or provide None or an empty string. Programs that pass a non-empty server_hostname value to these APIs continue to perform hostname verification as expected.

2

Is an update required to restore hostname verification?

No. Passing a valid, non-None, non-empty server_hostname value to the affected API restores certificate hostname verification without updating Python or applying the patch.

3

How can we identify vulnerable code paths?

Review calls to SSLContext.wrap_bio(), asyncio.create_connection(), and asyncio.loop.start_tls() where hostname checking is enabled. Flag calls that do not supply server_hostname, or that can supply None or an empty string, because the affected behavior silently skips hostname verification.

4

What changes after applying the patch or upgrading Python?

The patched behavior raises ValueError when hostname checking is enabled but server_hostname is missing, None, or empty, rather than silently skipping hostname verification. Supplying a valid non-empty hostname avoids this error and preserves expected verification behavior.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203