Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessGain on-path MITM position
-
DeliveryAppend forged lines after STARTTLS OK
-
ExploitClient buffers plaintext in _readbuf pre-handshake
-
ExecutionTLS completes with legitimate server and valid cert
-
Persistreadline() returns injected lines as TLS data
-
ImpactClient accepts forged CAPABILITY and tagged completion
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A04:2025 - Cryptographic Failures
ASVS 5.0
V12 - Secure Communication Transport encryption
|
| Exploitation Conditions | Requires an active on-path (MITM) attacker between the IMAP client and server; the attacker cannot break TLS and does not need to defeat certificate validation, since the handshake completes with the genuine server and a valid certificate. The forged plaintext must arrive in the same recv() as the server's tagged OK to STARTTLS so it lands in imaplib's _readbuf read-ahead buffer before the TLS wrap. The affected code path is specifically applications calling Python imaplib.IMAP4.starttls() (CPython before 3.16.0). Limiting factors that reduce real-world risk: the required on-path position, the precise pre-handshake timing of the injection into the read-ahead buffer, and the fact that the target application must actually use imaplib's STARTTLS flow; impact is confined to session integrity (forged responses/command completions). |
| Impact | Signals are mutually consistent and point to a genuine but bounded, medium-severity issue rather than a drop-everything emergency. The vendor CVSS 4.0 score is 6.3 (Medium) with VI:L as the only impact and AT:P, meaning exploitation depends on a specific attack requirement - the attacker must hold an on-path (MITM) position and land forged plaintext in the same recv() as the server's STARTTLS OK. There is no CISA KEV listing (not confirmed actively exploited) and no EPSS score was provided in the input, so probabilistic exploitation likelihood cannot be quantified here; absence of EPSS/KEV is a data gap, not evidence of safety. The vuln.today decision label is 'this_month', which aligns with the medium CVSS and the on-path precondition - this is a real priority to patch on a normal cadence, not an automatable, internet-wide mass-exploitation risk. The barrier (privileged network position plus precise pre-handshake timing) keeps realistic exploitation targeted; the CVSS and decision signals do not conflict and do not appear inflated. Impact is limited to integrity of the IMAP session (forged CAPABILITY and forged tagged command completions), not confidentiality or availability per the vendor vector. |
| Exploit ScenarioDerived | An on-path attacker between a Python imaplib IMAP4 client using STARTTLS and its server appends forged plaintext - for example '* CAPABILITY ... INJECTED' followed by a forged tagged OK - immediately after the server's STARTTLS OK, within the same TCP segment. The TLS handshake then completes normally against the genuine server with a valid certificate, but imaplib returns the buffered pre-TLS bytes as the first 'protected' responses, so the client trusts attacker-controlled capabilities and command results. No public weaponized exploit is identified at time of analysis, though the fix's test suite publicly demonstrates the injection mechanism. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 11, 2026
Python's imaplib.IMAP4.starttls() can accept forged plaintext IMAP responses that an on-path attacker appends to the server's STARTTLS reply, so the client treats them as the first responses received inside the TLS session - enabling a forged CAPABILITY list and a forged tagged completion of the next command. Applications using the STARTTLS flow in CPython before 3.16.0 are affected; the attacker cannot break TLS or defeat certificate validation because the handshake still completes with the genuine server and its valid certificate. Impact is confined to session integrity (assessed CVSS 3.1 AV:N/AC:H/PR:N/UI:N/C:N/I:L/A:N, vendor CVSS 4.0 score 6.3), exploitation requires a precisely timed on-path injection into imaplib's read-ahead buffer, and no public exploit code or CISA KEV entry was identified at time of analysis.
RemediationAI
Vendor-released patch: CPython 3.16.0, which contains the imaplib change from PR 160370 - upgrade to CPython 3.16.0 or later, following the vendor announcement at https://mail.python.org/archives/list/security-announce@python.org/thread/LVAGFOFG26QVXEM6VXXPRMMOZBHM4CVB/ and the tracking issue https://github.com/python/cpython/issues/160369. After the fix, starttls() aborts with IMAP4.abort('unexpected data after STARTTLS response') whenever plaintext bytes remain buffered after the STARTTLS reply, and it clears _readbuf and untagged_responses so nothing received before TLS can be processed inside the protected channel; be aware that this stricter behaviour will also terminate connections to servers that legitimately pipeline extra data with the STARTTLS OK, and those servers should be adjusted or the client switched to implicit TLS. As a compensating control where an immediate interpreter upgrade is not possible, use imaplib.IMAP4_SSL (implicit TLS, typically port 993) instead of IMAP4 followed by starttls(), which avoids the vulnerable upgrade path entirely; the trade-off is that the mail server must expose an implicit-TLS port and offer a matching certificate, and servers configured for STARTTLS-only will need that listener enabled. Given the this_month priority label, no KEV status, and integrity-only impact, remediation can be scheduled within the normal monthly patch cycle rather than as an emergency change.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
imaplib performs its own line-oriented reading on top of a raw socket and keeps a read-ahead buffer, self._readbuf, plus a untagged_responses dictionary. When starttls() is called it wraps the socket in an SSLContext-created TLS socket, but prior to the fix it left both the read-ahead buffer and the accumulated untagged responses untouched. Because the server's tagged OK to STARTTLS and any plaintext bytes an on-path attacker injected can arrive in a single recv(), those attacker-supplied lines remain queued and are returned by readline() after the handshake, i.e. they are parsed as if they were received over the authenticated TLS channel. This is the STARTTLS command/response injection class previously described for other protocol implementations as CVE-2011-0411. The upstream fix (CPython PR 160370, tracked as gh-issue-160369) adds a guard in IMAP4.starttls() that raises IMAP4.abort('unexpected data after STARTTLS response') when any buffered bytes remain, and otherwise discards the pre-TLS state by resetting self._readbuf to an empty list and clearing self.untagged_responses before the TLS session is used; accompanying tests cover both the rejected buffered-plaintext case and the discarding of pre-TLS untagged responses. The affected component is the CPython standard-library imaplib module (EUVD records CPython 0 < 3.16.0); the CWE was not supplied in the source data.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
On-path MITM plus the need for forged bytes to share the recv() with the OK make it AC:H; no authentication needed (PR:N); only IMAP session-response integrity is affected (I:L), with no confidentiality or availability impact.
Primary rating from Vendor (python).
CVSS VectorVendor: python
Lifecycle Timeline
2DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
EUVD-2026-122790
GHSA-xmjp-7865-vg6q
NVD
CVE.org
EPSS
Exploit-DB