Plaintext bytes buffered before STARTTLS are trusted in imaplib
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- None · Low · None
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-319.
Summary
CPython before 3.16.0 has a flaw in imaplib: starttls() wraps the socket in TLS but keeps plaintext bytes already buffered, so they are read as responses over TLS (CWE-319). A network attacker who cannot break TLS can append forged lines after the server's STARTTLS OK, and the client accepts them as genuine responses.
Written with Claude Haiku 5.5 from the sources below · 2026-11-16
Description from the CNA
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Python Software Foundation | CPython | before 3.16.0 | 3.16.0 | Patch available | CNA |
- CPython VendorPython Software Foundation Affected before 3.16.0 Fixed in 3.16.0 Patch available CNA
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:python:python:*:*:*:*:*:*:*:* | — | — | python-pillow |
- cpe:2.3:a:python:python:*:*:*:*:*:*:*:* Versions — — ·python-pillow
Remediation
Upgrade CPython to 3.16.0, the fixed version.
Written with Claude Haiku 5.5 from the sources below · 2026-11-16
- Fix · CNA CPython (Python Software Foundation) Fixed in 3.16.0
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Release ·
Python Software Foundation CPython 3.16.0
2 records Highest priority Priority LOW 2 LOW
Other records, highest priority first
- TI-2026-87867 Module shadowing in CPython gzip, tarfile and zipfile CLIPriority LOW 25
Timeline
- 2026-11-10 Threatist record created from CVE-2026-115559
- 2026-11-10 Alias added: GHSA-xmjp-7865-vg6q
- 2026-11-12 Priority changed: MEDIUM → LOW
- 2026-11-16 Weakness changed · CISA ADP
- 2026-11-16 CISA SSVC decision points changed
References
More Python Software Foundation vulnerabilities
- TI-2024-07037 Quadratic complexity parsing cookies with backslashes CVSS 3.1HIGH 7.5
- TI-2024-11791 Bypass extraction filter to modify file metadata outside extraction directory CVSS 3.1MEDIUM 5.3
- TI-2024-00411 Quoted zip-bomb protection for zipfile CVSS 3.1MEDIUM 6.2
- TI-2026-13296 `HTTPPasswordMgr` can send saved HTTPS credentials via HTTP because of incorrect scheme matching CVSS 4.0MEDIUM 6.0
- TI-2024-06422 Email header injection due to unquoted newlines CVSS 3.1MEDIUM 5.5
- TI-2026-04606 Possible to hijack modules in current working directory CVSS 4.0MEDIUM 5.6
Sources
- CVE-2026-115559 · CVE Program
- CVE-2026-115559 · NVD
- FIRST EPSS
- GHSA-xmjp-7865-vg6q · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences