Skip to main content

CPython CVE-2026-19445

| EUVDEUVD-2026-90077 CRITICAL
Use After Free (CWE-416)
2026-09-30 PSF GHSA-7jvw-f348-84gq
Critical
Disputed · 9.2 Vendor: PSF
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify Python TLS server using per-connection SNI contexts
  2. Delivery
    Connect as unauthenticated TLS client
  3. Exploit
    Force second ClientHello via HelloRetryRequest
  4. Execution
    Original SSLContext already freed by app
  5. Persist
    Servername callback dereferences freed pointer
  6. Impact
    Server crash / use-after-free (DoS)

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitable ONLY against a Python TLS server that (1) sets an ssl.SSLContext.sni_callback which reassigns a different context to SSLSocket.context, AND (2) does not retain a reference keeping the original callback-carrying SSLContext alive - i.e. servers that create an SSLContext per connection or replace it while connections are open. Triggering typically also requires inducing a second ClientHello on the connection (e.g. a TLS 1.3 HelloRetryRequest, achievable by offering a key share the server rejects) or a callback that raises after switching context. LIMITING FACTORS: servers that wrap their listening socket with the SSLContext (the common, documented pattern) or otherwise store it on the server object are NOT affected; pure TLS clients are NOT affected. These non-default coding requirements are why the vector carries AC:H/AT:P despite remote unauthenticated access.

Impact

Signals conflict on severity. The vendor CVSS 4.0 base score is 9.2 (Critical) with VC:H/VI:H/VA:L, but the description and the fix itself indicate the demonstrated, reproducible impact is a server crash / call through a freed pointer (denial of service), not confirmed confidentiality or integrity compromise - the VC:H/VI:H rating appears aggressive relative to the evidence. The vector correctly captures the access model: AV:N (a remote TLS client triggers it), PR:N (unauthenticated), UI:N (no user interaction), but AC:H and AT:P reflect that exploitation is NOT universal - it fires only against servers in a specific vulnerable configuration and often requires inducing a second ClientHello (TLS 1.3 HelloRetryRequest) or a raising callback. There is no EPSS score, no CISA KEV listing, and no public weaponized exploit provided; the CPython patch does ship regression tests that deterministically reproduce the crash, which lowers the barrier to building a DoS PoC but is not itself an in-the-wild exploit. Net: this is a real, patch-worthy memory-safety bug in a ubiquitous runtime, but the narrow set of affected server patterns (per-connection SSLContext or context replacement with the original dropped) means real-world exposure is far smaller than the 9.2 suggests - treat as a medium operational priority weighted by whether your Python TLS servers use dynamic per-connection SNI contexts.

Exploit ScenarioDerived

A Python TLS server creates a fresh ssl.SSLContext per connection (or swaps contexts while connections are live), installs an sni_callback that reassigns SSLSocket.context to another context, and keeps no lasting reference to the callback-carrying context. A remote unauthenticated client connects and - typically by forcing a TLS 1.3 HelloRetryRequest so a second ClientHello re-enters the servername callback, or by having the callback raise after switching context - causes OpenSSL to reach the freed SSLContext, crashing the server or dereferencing a freed pointer. No public weaponized exploit is identified, though the vendor patch includes reproducer tests that demonstrate the crash.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 30, 2026

A use-after-free in CPython's ssl module lets a remote, unauthenticated TLS client crash a Python TLS server process - or make it call through a freed pointer - when the server's SSLContext.sni_callback reassigns a different SSLContext to SSLSocket.context and nothing else keeps the original callback-bearing context alive. Only this non-default coding pattern is exploitable (typically per-connection SSLContext creation or context replacement while connections are open), and triggering generally requires a second ClientHello on the connection - e.g. a TLS 1.3 HelloRetryRequest induced by offering a rejected key share - or a callback that raises after switching context; servers that wrap their listening socket with the SSLContext and pure TLS clients are unaffected. No public exploit code or confirmed active exploitation was identified at time of analysis, and the vendor-reported CVSS 4.0 score of 9.2 conflicts with an independent CVSS 3.1 assessment of 6.9 (AV:N/AC:H/PR:N/UI:N/C:L/I:L/A:H), which reflects the restrictive, non-default prerequisites rather than unqualified remote code execution.

RemediationAI

Upstream fix available (PR/commit); released patched version not independently confirmed - the vendor reports patch availability, and the upstream change is PR https://github.com/python/cpython/pull/158504 addressing issue https://github.com/python/cpython/issues/156293, so the first action is to apply the patched CPython release once its version is confirmed in the PSF advisory at https://mail.python.org/archives/list/security-announce@python.org/thread/QMQIUQB6WGGC3MI7I3WKQXOYOBDSPPS3/. If upgrading is not immediately possible, apply the documented workaround: keep a strong reference to every SSLContext that sets sni_callback for the entire lifetime of the server (the usual safe pattern is one long-lived context that wraps the listening socket or is stored on the server object), and stop creating or replacing an SSLContext per connection - the trade-off is that naively retaining per-connection contexts indefinitely can itself grow memory without bound, so per-connection designs should instead be refactored to a single long-lived SNI-dispatching context. As a compensating control, the upstream patch shows that clearing the servername callback on the SSL_CTX before its Python wrapper is released (equivalent to setting ssl_context.sni_callback = None on contexts that are about to be dropped) removes the dangling-callback path, at the cost of losing SNI-based certificate selection for connections still served by that context; applications that must retain sni_callback should also avoid reassigning SSLSocket.context inside it and instead select certificates through other means. Note that because triggering requires a second ClientHello (e.g. a HelloRetryRequest) or a raising callback, there is no simple network filter - blocking TLS 1.3 HelloRetryRequest patterns is not a viable control - so patching or the reference-lifetime workaround are the effective options, and TLS clients require no action.

Affected VersionsENISA

CPython 0 <3.16.0

Affected Packages

euvd cpython fix: 3.16.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The flaw is a CWE-416 use-after-free in CPython's _ssl C extension (Modules/_ssl.c), which binds Python to OpenSSL. OpenSSL invokes a per-SSL_CTX SNI servername callback (SSL_CTX_set_tlsext_servername_callback) to let applications select a certificate by server name; CPython registered a C shim whose user argument was a borrowed pointer to the PySSLContext that installed the callback. When an application's sni_callback (the documented way to pick a certificate per SNI name) assigns a new context to SSLSocket.context, the original SSL_CTX lives on as the connection's session_ctx while its Python wrapper object can be freed once the application drops its last reference - leaving the borrowed pointer dangling and the Python callback registered. OpenSSL then reaches the shim again through the connection's session_ctx (for example on the second ClientHello after a HelloRetryRequest, or when the callback raises after the swap) and the shim dereferences freed memory. The upstream fix takes two complementary steps: context_dealloc() now clears the SSL_CTX's servername callback (SSL_CTX_set_tlsext_servername_callback(ctx, NULL)) so no Python callback survives deallocation, and _servername_callback resolves the context from the socket's current, always-live context via SSL_get_app_data() plus Py_NewRef under a critical section instead of trusting the SSL_CTX user argument. The CPE string cpe:2.3:a:python_software_foundation:cpython:*:*:*:*:*:*:*:* is an unbounded wildcard, so the input data does not pin a precise affected version range; the defect class and code path exist wherever the ssl module's sni_callback can reassign SSLSocket.context.

Know when Cpython gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Sources disagree (Medium–Critical)
Vendor (PSF) PRIMARY 9.2 CRITICAL
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N
vuln.today AI 7.0 HIGH

Remote unauthenticated (AV:N/PR:N) but needs a non-default per-connection SNI config plus a second-ClientHello trigger (AC:H); demonstrated impact is a crash (A:H) with only speculative UAF-driven C/I (C:L/I:L).

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:H
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N
SUSE 6.5 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H
Red Hat 8.1 HIGH

vuln.today treats the vendor’s rating as authoritative. A higher third-party CVSS (e.g. CISA-ADP) is shown for transparency but does not drive the headline severity.

CVSS VectorVendor: PSF

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

CPython's ssl module contains a critical use-after-free that can let a remote, unauthenticated TLS client crash or corrupt a Python TLS server process when the server uses a non-default SNI callback pattern that reassigns SSLContext objects during the handshake. The exposure is limited to services that dynamically swap SSLSocket.context or create per-connection SSLContext objects; default Python TLS servers and pure TLS clients are unaffected. No public exploit code or confirmed active exploitation has been identified, but a vendor patch is available, so leadership should prioritize confirming whether any internet-facing Python services use the vulnerable pattern and ensure they are patched.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.5%
Top 58% exploitable
Prevalence
Ubiquitous
CPython ssl module is a core component of an extremely widely deployed language runtime
Social Media
2
Sightings
Data Quality
7 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

47
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

CVE-2026-17084 MEDIUM POC
6.0 Aug 18

Integrity bypass in CPython's stringprep module causes divergent domain name normalization when processing international

CVE-2026-6100 CRITICAL
9.1 Apr 13

CPython decompression modules (lzma, bz2, gzip) allow memory corruption via use-after-free when decompressor instances a

CVE-2026-3298 HIGH
8.8 Apr 21

Out-of-bounds buffer write in CPython's asyncio.ProactorEventLoop (Windows only) allows remote attackers to trigger memo

CVE-2026-11972 HIGH
8.2 Jun 23

Denial of service in CPython's tarfile module allows remote attackers to trigger an infinite loop by supplying a crafted

CVE-2026-9669 HIGH
8.2 Jun 08

Stack-based buffer overflow in CPython's bz2.BZ2Decompressor allows remote attackers to crash Python applications by sen

CVE-2026-11940 HIGH
7.8 Jun 23

Path traversal in CPython's tarfile module allows a crafted tar archive to bypass the 'data' and 'tar' extraction filter

CVE-2026-19553 HIGH
7.6 Sep 30

Certificate hostname verification is silently skipped in CPython's TLS stack when an application enables SSLContext.chec

CVE-2026-4786 HIGH
7.0 Apr 13

Command injection in CPython's webbrowser.open() API bypasses previous CVE-2026-4519 mitigation via specially crafted UR

CVE-2026-4519 HIGH
7.0 Mar 20

The webbrowser.open() API in CPython accepts URLs with leading dashes, which certain web browsers interpret as command-l

CVE-2026-7774 MEDIUM
6.9 Jun 04

Path traversal in CPython's tarfile module allows malicious tar archives to bypass the data_filter safety mechanism and

CVE-2026-19672 MEDIUM
6.3 Aug 19

CPython's tarfile module on POSIX platforms creates empty directories outside the intended extraction destination when p

CVE-2026-7210 MEDIUM
6.3 May 11

XML parsers in CPython's xml.parsers.expat and xml.etree.ElementTree modules use insufficient entropy for Expat hash-flo

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SLES15-SP5-CHOST-BYOS-SAP-CCloud Affected
SLES15-SP5-CHOST-BYOS-SAP-CCloud Affected
SLES15-SP6-CHOST-BYOS Affected
SLES15-SP6-CHOST-BYOS Affected
SLES15-SP6-CHOST-BYOS-Aliyun Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy