Technical impact
The flaw occurs when Python’s imaplib wraps the socket in TLS via STARTTLS but fails to reset its internal read‑ahead buffer. Plaintext bytes that arrive in the same network packet containing the server’s OK to STARTTLS remain in the buffer and are later returned as if they were encrypted. A network attacker who cannot decrypt TLS but can influence the ordering of packets can inject forged responses after the OK line. The client then accepts these forged CAPABILITY lists and command completions as genuine, potentially misleading application logic and allowing the attacker to manipulate the client’s behavior. According to the CWE list, it is classified as CWE-319, indicating improper handling of sensitive information. This injection class of vulnerability resembles CVE‑2011‑0411 and can lead to improper authentication logic or data disclosure, but does not provide direct code execution.
Affected Systems
The issue affects CPython’s built‑in IMAP client library (imaplib) in all releases that implement the STARTTLS wrapper. No specific version range is specified, so any CPython version that uses the legacy imaplib implementation is susceptible.
Risk and Exploitability
The CVSS score of 6.3 indicates moderate severity. The EPSS score of less than 1 percent reflects a very low probability of exploitation in practice. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires an attacker who can interpose between the client and the IMAP server during the STARTTLS handshake, which is typically limited to those on the same network path or using a compromised network router. While the attack surface is narrow, the potential impact on authenticated client sessions warrants prompt attention.