// Security Advisory Triage

Python TLS servers crash via SNI callback use-after-free

Python security announcements · published 2026-09-30 22:01 UTC
ACTION NEEDED MITIGATE SECURITYAPI
WHAT CHANGEDCVE-2026-19445 disclosed 30 September 2026. Remote unauthenticated clients can crash Python TLS servers or trigger arbitrary code execution when the server's sni_callback switches SSLContext and the original context is garbage collected. Affects servers that create an SSLContext per connection or replace it while connections are open. Fix available in PR #158504.
WHY IT MATTERSAny Python TLS server using sni_callback to select certificates by server name is remotely exploitable without authentication. Attacker can crash the service or potentially execute code. Servers wrapping a listening socket with a single persistent context are not affected.
WHAT TO DOCheck whether your Python TLS servers use sni_callback and create or replace SSLContext objects during operation. If yes, apply the mitigation immediately: retain a reference to every SSLContext that sets sni_callback for the server's lifetime. Monitor the CVE and PR #158504 for patched Python releases.
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-19445] Use-after-free of a server-side SSLContext when sni_callback switches contexts
+https://mail.python.org/archives/list/security-announce@python.org/message/QMQIUQB6WGGC3MI7I3WKQXOYOBDSPPS3/
+Wed, 30 Sep 2026 16:10:08 +0000
+
+There is a CRITICAL severity vulnerability affecting CPython.
+
+A remote, unauthenticated TLS client can make a server crash or call
+through a freed pointer if its sni_callback assigns a different context to
+SSLSocket.context (the documented way to select a certificate per server
+name) and nothing else keeps the original ssl.SSLContext alive. Typical
+cases are servers that create an SSLContext per connection or replace it
+while connections are open; servers that wrap their listening socket with
+it are not affected.
+
+Mitigation: keep a reference to every SSLContext that sets sni_callback for
+the lifetime of the server. TLS clients are not affected.
+
+Please see the linked CVE ID for the latest information on affected
+versions:
+
+* https://www.cve.org/CVERecord?id=CVE-2026-19445
+* https://github.com/python/cpython/pull/158504
HOW IT WAS JUDGED
Triage signals below are model-reported assertions, preserved verbatim; they are not independent arithmetic verification.
triage verdictMATERIAL at 0.98, needed 0.5
triage reasoningCritical use-after-free in Python's ssl module affecting TLS servers. Remote, unauthenticated exploitation possible.
signalsPython runtime vulnerability · CRITICAL severity · use-after-free / memory safety · remote unauthenticated exploitation · server crash or arbitrary code execution · affects TLS/SSL handling in standard library · CVE with fix PR available
suppression—
triage modelanthropic/claude-haiku-4.5 ($0.00000)
writer modelanthropic/claude-sonnet-4.5 ($0.00000)