Vulnerability DatabaseCVE-2026-115559

CVE-2026-115559: 
Python Interpreter vulnerability analysis and mitigation

Overview

CVE-2026-115559 is a STARTTLS command/response injection vulnerability in Python's imaplib module (CPython) that allows a network attacker to inject forged IMAP server responses into the post-handshake encrypted channel. The root cause is that IMAP4.starttls() wraps the socket in TLS but does not clear self._readbuf (the library's internal read-ahead buffer), allowing plaintext bytes received alongside the server's OK response to STARTTLS to be returned by readline() after the TLS handshake completes. All CPython versions before 3.16.0 are affected. The vulnerability was reported on October 22, 2026, patched and merged on November 10, 2026, and published the same day. It carries a CVSS v4.0 base score of 6.3 (Medium) (Feedly, CPython PR).

Technical details

The vulnerability is classified as CWE-319 (Cleartext Transmission of Sensitive Information) and is analogous to the STARTTLS injection class described in CVE-2011-0411. When a Python IMAP client sends a STARTTLS command, the server's OK response and any attacker-appended forged lines may arrive in the same TCP segment and be buffered in self._readbuf before the TLS handshake begins. Because IMAP4.starttls() does not flush or validate this buffer, the forged lines are subsequently returned by readline() as if they were TLS-protected server responses — allowing injection of fake CAPABILITY announcements or forged tagged command completions. Additionally, untagged_responses must also be discarded, as noted during code review (CPython PR, CPython Issue). Exploitation requires the attacker to be a network-positioned adversary (man-in-the-middle) capable of injecting bytes into the TCP stream before TLS is established, but does not require breaking TLS or possessing a valid certificate (Feedly).

Impact

A successful attacker can cause an IMAP client using Python's imaplib to accept forged server responses — including fabricated CAPABILITY lists and spoofed tagged command completions — as legitimate TLS-protected messages. This primarily affects integrity: the client may be deceived about server capabilities or believe a command (such as LOGIN) succeeded or failed based on attacker-controlled data. While confidentiality and availability impacts are rated as none, the injection could facilitate authentication bypass or manipulation of client behavior in applications relying on imaplib for secure email access (Feedly, CPython PR).

Exploitability

There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation as of the time of publication (Feedly). The EPSS score is approximately 0.287%, indicating a low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires a network-positioned attacker capable of injecting bytes into the TCP stream between the IMAP client and server prior to TLS negotiation, making opportunistic mass exploitation unlikely. No threat actor attribution has been reported.

Exploitation steps

  1. Position on the network: Gain a man-in-the-middle position between the target Python IMAP client and the IMAP server (e.g., via ARP spoofing, rogue Wi-Fi, or BGP hijacking on the relevant network segment).
  2. Intercept the STARTTLS exchange: Monitor the TCP stream for the client's STARTTLS command and the server's tagged OK response (e.g., A001 OK Begin TLS negotiation now).
  3. Inject forged plaintext: Immediately after the server's OK response bytes, inject additional plaintext IMAP response lines (e.g., a forged * CAPABILITY IMAP4rev1 AUTH=PLAIN or a forged tagged response like A002 OK LOGIN completed) into the same TCP segment or a closely following one, before the TLS handshake bytes begin.
  4. Allow TLS handshake to complete: Let the real TLS handshake proceed normally between the client and the legitimate server with a valid certificate — the client will not detect the injection because the forged bytes are already in self._readbuf.
  5. Forged responses accepted: After the handshake, the client's readline() returns the attacker-injected lines as if they were TLS-protected server responses, potentially causing the client to accept false capability advertisements or believe a subsequent command completed successfully (Feedly, CPython PR).

Indicators of compromise

  • Network: Unexpected or anomalous TCP segments containing IMAP plaintext response lines immediately following the server's STARTTLS OK response, prior to the TLS ClientHello; unusual IMAP capability strings (e.g., advertising unsupported AUTH mechanisms) observed in client-side logs.
  • Logs: Application logs showing unexpected IMAP CAPABILITY responses or command completions immediately after STARTTLS negotiation; IMAP client errors or unexpected authentication outcomes that do not match server-side records.
  • Process/Application: Python applications using imaplib that report unexpected server capabilities or premature command completions after STARTTLS; anomalous behavior in email clients or automation scripts relying on imaplib for IMAP access.

Mitigation and workarounds

The fix is to upgrade CPython to version 3.16.0 or later, where IMAP4.starttls() now raises an abort exception if any data is found in self._readbuf after the STARTTLS OK response, and also discards untagged_responses before completing the TLS handshake (CPython PR). Backports have been initiated for CPython 3.11, 3.12, 3.13, 3.14, and 3.15 branches; users on these versions should apply the relevant backport patches when available. As a workaround where upgrading is not immediately possible, consider using IMAP over implicit TLS (port 993) instead of STARTTLS, which avoids the plaintext upgrade negotiation entirely (Feedly).

Community reactions

The vulnerability was discussed on the oss-security mailing list shortly after disclosure (oss-sec). The Python Security Announce mailing list published an advisory (Python Security Announce). The issue was flagged as a release-blocker by CPython maintainer Seth Michael Larson, reflecting the Python core team's prioritization of the fix for inclusion in the 3.16.0 alpha 2 release. Community reaction on Bluesky noted the similarity to the long-standing CVE-2011-0411 class of STARTTLS injection bugs (Bluesky). Tenable published a Nessus detection plugin (ID 380016) for the vulnerability (Tenable).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

python3.11

Affected

sid

python3.15

Affected

trixie

python3.13

Affected

Ubuntu

Unknown

bionic (esm-apps)

python3.7

Unknown

bionic (esm-infra)

python2.7

Unknown

devel

python3.14

Unknown

focal (esm-apps)

python2.7

Unknown

focal (esm-infra)

python3.8

Unknown

jammy

python2.7

Unknown

jammy (esm-apps)

python2.7

Unknown

noble

python3.12

Unknown

RHEL / CentOS

Affected

RHEL 8

python3.12.src

Affected

RHEL 9

python3.9.src

Affected

RHEL 10

python3.12.src

Affected

Source: This report was generated using AI

Related Python Interpreter vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-115559MEDIUM6.3
  • Python Interpreter logoPython Interpreter
  • python3.16-debuginfo
NoYesNov 10, 2026
CVE-2026-124249MEDIUM6.3
  • Python Interpreter logoPython Interpreter
  • python3.12-idle
NoYesNov 09, 2026
CVE-2026-115791MEDIUM5.3
  • Python Interpreter logoPython Interpreter
  • python3
NoYesNov 10, 2026
CVE-2026-16052LOW2.3
  • Python Interpreter logoPython Interpreter
  • python3.14-freethreading-libs
NoYesNov 12, 2026
CVE-2026-19552NONEN/A
  • Python Interpreter logoPython Interpreter
  • python-tools
NoYesNov 09, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management