imaplib STARTTLS serves plaintext bytes buffered before the handshake as if they came over TLS
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| Python Software FoundationCPython |
< 3.16.0→ 3.16.0 |
3.16.0 |
| Bitnamilibpython |
< 3.16.0→ 3.16.0 |
3.16.0 |
| Bitnamipython |
< 3.16.0→ 3.16.0 |
3.16.0 |
| Bitnamipython-min |
< 3.16.0→ 3.16.0 |
3.16.0 |
Fix status by distribution
Records published by each distribution for this CVE. Fixed versions differ by release; check each link.
- BellSoft Alpaquita BELL-CVE-2026-115559 python3 Fix available
- Debian DEBIAN-CVE-2026-115559 python3.15, python3.14, python3.13 +1 more No fixed version in this record
- Ubuntu UBUNTU-CVE-2026-115559 python3.14, python3.12, python3.11 +8 more No fixed version in this record
Original description The description as published by the source.
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.
Source: Python security-announce NVD GitHub Advisory
References
- advisory mail.python.org
- advisory nvd.nist.gov
- advisory github.com
- package github.com
- patch github.com
- PYTHON-SECURITY-ANNOUNCE [Security-announce][CVE-2026-115559] imaplib STARTTLS serves plaintext bytes buffered before the handshake as if they came over TLS
- report github.com
- web mail.python.org
- web github.com