CVE-2026-19553: CWE-297 in Python Software Foundation CPython
CVE-2026-19553 is a vulnerability in Python's CPython ssl module where the ssl.SSLContext.wrap_bio() method did not require the server_hostname argument to be non-None when SSLContext.check_hostname was enabled. This caused hostname verification to be silently skipped if server_hostname was omitted, potentially leading to false assumptions of secure certificate verification. The issue affects Python versions before 3.16.0. Mitigation involves passing a valid non-empty server_hostname to relevant APIs. A patch changes the behavior to raise a ValueError instead of silently skipping verification.
AI Analysis
Technical Summary
The vulnerability arises because ssl.SSLContext.wrap_bio() and related APIs did not enforce that the server_hostname parameter be non-None when SSLContext.check_hostname was set to True. Without a valid server_hostname, hostname verification was silently bypassed, allowing programs to mistakenly believe hostname verification succeeded. This affects CPython versions prior to 3.16.0. The vulnerability is classified as CWE-297 (Improper Validation of Certificate with Host Mismatch). Mitigation does not require patching; passing a valid server_hostname ensures hostname verification proceeds correctly. The patch changes the behavior to raise an error if server_hostname is missing, preventing silent skips.
Potential Impact
Programs using ssl.SSLContext.wrap_bio() or related APIs with SSLContext.check_hostname enabled but without providing a valid server_hostname may silently skip hostname verification. This can lead to trust in TLS connections without proper hostname validation, increasing the risk of man-in-the-middle attacks. However, if a valid server_hostname is provided, the vulnerability does not affect the program. There are no known exploits in the wild. The CVSS 4.0 score is 7.6 (high severity), reflecting network attack vector, low attack complexity, partial attack and user interaction, and high impact on confidentiality and integrity.
Mitigation Recommendations
To mitigate this vulnerability, ensure that a valid, non-None, and non-empty server_hostname argument is passed to ssl.SSLContext.wrap_bio(), asyncio.create_connection(), or asyncio.loop.start_tls() when SSLContext.check_hostname is enabled. This causes hostname verification to proceed as intended. Upgrading to Python 3.16.0 or later or applying the patch changes the behavior to raise a ValueError if server_hostname is omitted, preventing silent verification skips. No immediate patching is required if the mitigation is applied correctly.
CVE-2026-19553: CWE-297 in Python Software Foundation CPython
Description
CVE-2026-19553 is a vulnerability in Python's CPython ssl module where the ssl.SSLContext.wrap_bio() method did not require the server_hostname argument to be non-None when SSLContext.check_hostname was enabled. This caused hostname verification to be silently skipped if server_hostname was omitted, potentially leading to false assumptions of secure certificate verification. The issue affects Python versions before 3.16.0. Mitigation involves passing a valid non-empty server_hostname to relevant APIs. A patch changes the behavior to raise a ValueError instead of silently skipping verification.
CVSS v4.0
Score 7.6high
Affected software
Python Software Foundation
CPython
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability arises because ssl.SSLContext.wrap_bio() and related APIs did not enforce that the server_hostname parameter be non-None when SSLContext.check_hostname was set to True. Without a valid server_hostname, hostname verification was silently bypassed, allowing programs to mistakenly believe hostname verification succeeded. This affects CPython versions prior to 3.16.0. The vulnerability is classified as CWE-297 (Improper Validation of Certificate with Host Mismatch). Mitigation does not require patching; passing a valid server_hostname ensures hostname verification proceeds correctly. The patch changes the behavior to raise an error if server_hostname is missing, preventing silent skips.
Potential Impact
Programs using ssl.SSLContext.wrap_bio() or related APIs with SSLContext.check_hostname enabled but without providing a valid server_hostname may silently skip hostname verification. This can lead to trust in TLS connections without proper hostname validation, increasing the risk of man-in-the-middle attacks. However, if a valid server_hostname is provided, the vulnerability does not affect the program. There are no known exploits in the wild. The CVSS 4.0 score is 7.6 (high severity), reflecting network attack vector, low attack complexity, partial attack and user interaction, and high impact on confidentiality and integrity.
Mitigation Recommendations
To mitigate this vulnerability, ensure that a valid, non-None, and non-empty server_hostname argument is passed to ssl.SSLContext.wrap_bio(), asyncio.create_connection(), or asyncio.loop.start_tls() when SSLContext.check_hostname is enabled. This causes hostname verification to proceed as intended. Upgrading to Python 3.16.0 or later or applying the patch changes the behavior to raise a ValueError if server_hostname is omitted, preventing silent verification skips. No immediate patching is required if the mitigation is applied correctly.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- PSF
- Date Reserved
- 2026-08-11T15:22:03.833Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6abd3d882a4e24523d41fc82
Added to database: 09/30/2026, 16:49:12 UTC
Last enriched: 09/30/2026, 17:03:08 UTC
Last updated: 09/30/2026, 17:04:58 UTC
Views: 6
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.