Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
INF2005-ACW3-PythonSSL — Proof-of-concept and remediation lab for CVE-2026-19553, demonstrating TLS hostname verification bypass in Python's SSLContext.wrap_bio() with local CA, server, and patched-version comparison. | Kitploit
Tools/GitHubGitHub/tharsh2003/inf2005-acw3-pythonssl
Vulnerability AnalysisExploitationWeb SecurityNetwork SecurityCryptographyLearning & EducationLabs & Practice
GitHubtharsh2003/inf2005-acw3-pythonssl

INF2005-ACW3-PythonSSL

Proof-of-concept and remediation lab for CVE-2026-19553, demonstrating TLS hostname verification bypass in Python's SSLContext.wrap_bio() with local CA, server, and patched-version comparison.

View Repository
12 days agoNot yet reviewed
Share

CVE-2026-19553 — Python TLS Hostname Verification Vulnerability

1. Project Overview

This project demonstrates CVE-2026-19553, a TLS hostname verification vulnerability affecting Python's SSLContext.wrap_bio() method.

The objective is to investigate how a TLS handshake can succeed without verifying the server's hostname, even when hostname checking is enabled.

The project includes a locally hosted TLS server, a test certificate authority, an exploitation script, an application-level remediation, and a comparison between vulnerable and patched Python versions.

All exploitation testing is performed locally using 127.0.0.1. No external servers or production systems are targeted.

2. Vulnerability Description

CVE-2026-19553 concerns improper hostname verification when using Python's SSLContext.wrap_bio() method.

In vulnerable Python versions, supplying server_hostname=None can allow a TLS handshake to succeed without checking the server's certificate against an expected hostname, despite check_hostname=True.

This occurs because the TLS connection is created without an expected hostname for certificate matching.

Although certificate-chain verification may still be performed, the absence of hostname verification means that a certificate issued by a trusted certificate authority could be accepted without confirming that it belongs to the intended server.

This could potentially allow server impersonation or man-in-the-middle attacks, depending on the application's trust configuration and network environment.

CVE details:

  • CVE ID: CVE-2026-19553
  • Affected component: Python / CPython SSLContext.wrap_bio()
  • Severity: High
  • CVSS score: 7.6
  • Vulnerable version tested: Python 3.14.7
  • Patched version tested: Python 3.14.10

3. Testing Environment

The experiment was conducted using the following environment:

  • Operating system: Windows
  • Development environment: Visual Studio Code
  • Vulnerable Python version: 3.14.7
  • Vulnerable OpenSSL version: 3.5.7
  • Patched Python version: 3.14.10
  • Patched OpenSSL version: 3.5.9
  • TLS server address: 127.0.0.1
  • TLS server port: 8443
  • Server certificate hostname: attacker.test
  • Certificate generation library: cryptography

A local certificate authority (CA) was generated to sign the test server certificate.

The TLS client was configured to trust this CA so that the experiment could focus specifically on hostname verification rather than certificate-chain trust failures.

4. Project Files

FileDescription
generate_certs.pyGenerates the local certificate authority and TLS server certificate
tls_server.pyStarts the locally hosted TLS server
exploit.pyTests TLS connections using SSLContext.wrap_bio()
patched_test.pyTests actual CPython behavior on vulnerable and patched Python versions
remediation.pyImplements application-level hostname validation and performs full TLS handshake verification
requirements.txtLists the required Python dependency
certs/Stores locally generated certificates and private keys
screenshots/Stores evidence of the exploitation and remediation results
.gitignoreExcludes generated certificates, private keys and temporary files from Git tracking

5. Exploitation and Remediation Results

Test 1 — Missing Hostname

The client was configured with:

context.check_hostname = True
server_hostname = None

The TLS server presented a certificate issued for attacker.test.

Observed output:

Python: 3.14.7
OpenSSL: OpenSSL 3.5.7 9 Jun 2026
server_hostname: None
check_hostname: True
verify_mode: 2
RESULT: TLS handshake successful
WARNING: Missing hostname was accepted

Result: Successful exploitation of the missing-hostname verification issue.

Although hostname verification was enabled, the TLS handshake completed without checking the server certificate against an expected hostname.

The server certificate was signed by the locally trusted CA, so certificate-chain verification could succeed even though hostname matching was not performed.

Test 2 — Incorrect Hostname

The client was configured with:

server_hostname = "localhost"

However, the TLS server certificate was issued for attacker.test.

Observed output:

RESULT: TLS connection rejected
Error: SSLCertVerificationError
certificate verify failed: Hostname mismatch,
certificate is not valid for 'localhost'.

Result: TLS connection rejected due to a hostname mismatch.

This demonstrates that hostname verification is enforced when an expected hostname is explicitly provided.

Test 3 — Vulnerable Versus Patched Python

The same SSLContext.wrap_bio() configuration was tested on two Python versions using:

context.check_hostname = True
server_hostname = None

Python 3.14.7 — Vulnerable runtime

Python version: 3.14.7
RESULT: Actual runtime accepted missing hostname
WARNING: No built-in rejection observed

Python 3.14.10 — Patched runtime

Python version: 3.14.10
RESULT: Actual runtime rejected missing hostname
Error: check_hostname requires server_hostname

Result: The vulnerable runtime accepted the missing hostname, while the patched runtime rejected it.

This comparison tests TLS object creation rather than performing a complete network handshake.

Test 4 — Application-Level Remediation with Full TLS Handshake

An additional safeguard was implemented in remediation.py.

The secure_wrap_bio() function checks that a non-empty hostname is supplied and that hostname verification is enabled before calling SSLContext.wrap_bio().

The updated remediation test also performs a full TLS handshake to determine whether the supplied hostname matches the server certificate.

Four hostname inputs were tested:

  • None — Missing hostname
  • "" — Empty hostname
  • "localhost" — Incorrect hostname
  • "attacker.test" — Correct hostname

Observed output:

CVE-2026-19553 - Full Remediation Test

Testing hostname: None
Application validation: REJECTED
Reason: A non-empty server_hostname is required
--------------------------------------------------
Testing hostname: ''
Application validation: REJECTED
Reason: A non-empty server_hostname is required
--------------------------------------------------
Testing hostname: 'localhost'
Application validation: PASSED
TLS handshake: REJECTED
Reason: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:
Hostname mismatch, certificate is not valid for 'localhost'.
--------------------------------------------------
Testing hostname: 'attacker.test'
Application validation: PASSED
TLS handshake: SUCCESS
--------------------------------------------------

Result: The remediation successfully demonstrated both application-level hostname validation and TLS certificate hostname verification.

When None or an empty string was supplied, the application rejected the input before creating the TLS object.

When localhost was supplied, application validation passed because a non-empty hostname was provided. However, the TLS handshake was rejected because the server certificate identified attacker.test, not localhost.

When attacker.test was supplied, application validation passed and the TLS handshake completed successfully because the hostname matched the server certificate.

These results demonstrate two separate security checks:

  1. Application-level validation prevents missing or empty hostnames from reaching SSLContext.wrap_bio().
  2. TLS certificate verification ensures that the supplied hostname matches the server certificate.

This application-level mitigation is separate from the official CPython patch.

6. Security Impact

TLS hostname verification is an important security mechanism that ensures a client is communicating with its intended server.

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    772
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    505
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    420
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    345
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    260
  • 6

    antifox

    antifox-ai/antifox

    AI multi-agent autonomous penetration testing platform that runs recon, attack-surface discovery, exploitation validation and evidence-backed report delivery.

    251

Explore all tools

Browse our collection of tools

View all tools →