CVE-2026-115559

imaplib STARTTLS serves plaintext bytes buffered before the handshake as if they came over TLS

Published Nov 10, 2026 CVSS 4.0 · 6.3 Medium EPSS < 1% KEV · Not listed
Description
IMAP4.starttls() wraps the socket in TLS but leaves self._readbuf, imaplib's own read-ahead buffer, untouched. Any plaintext bytes that arrived in the same recv() as the tagged OK to STARTTLS are returned by readline() after the handshake, so the client treats them as the first responses on the protected channel. A network attacker who cannot break TLS can append forged lines after the server's OK, let the handshake complete with the real server and a valid certificate, and have the client accept the forged CAPABILITY and the forged tagged completion of the next command. This is the STARTTLS command/response injection class of CVE-2011-0411.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-200
Type Values Removed Values Added
First Time appeared Python
Python cpython
Python Software Foundation
Python Software Foundation cpython
Vendors & Products Python
Python cpython
Python Software Foundation
Python Software Foundation cpython
Type Values Removed Values Added
Weaknesses CWE-200
Type Values Removed Values Added
Description IMAP4.starttls() wraps the socket in TLS but leaves self._readbuf, imaplib's own read-ahead buffer, untouched. Any plaintext bytes that arrived in the same recv() as the tagged OK to STARTTLS are returned by readline() after the handshake, so the client treats them as the first responses on the protected channel. A network attacker who cannot break TLS can append forged lines after the server's OK, let the handshake complete with the real server and a valid certificate, and have the client accept the forged CAPABILITY and the forged tagged completion of the next command. This is the STARTTLS command/response injection class of CVE-2011-0411.
Title imaplib STARTTLS serves plaintext bytes buffered before the handshake as if they came over TLS
References
Metrics cvssV4_0

{'score': 6.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N'}

Weaknesses

No weakness.

Sources

Status
PUBLISHED
Assigner
PSF
Published
Updated
Nov 10, 2026, 6:39 PM
Reserved
Oct 22, 2026, 10:10 PM
Status
Awaiting Analysis
Published
Nov 10, 2026, 7:19 PM
Modified
Nov 10, 2026, 7:19 PM