Skip to main content

Python imaplib CVE-2026-115559

| EUVDEUVD-2026-122790 MEDIUM
Cleartext Transmission of Sensitive Information (CWE-319)
2026-11-10 cna@python.org GHSA-xmjp-7865-vg6q
6.3
CVSS 4.0 · Vendor: python
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain on-path MITM position
  2. Delivery
    Append forged lines after STARTTLS OK
  3. Exploit
    Client buffers plaintext in _readbuf pre-handshake
  4. Execution
    TLS completes with legitimate server and valid cert
  5. Persist
    readline() returns injected lines as TLS data
  6. Impact
    Client 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

CPython 0 <3.16.0

Affected Packages

euvd cpython fix: 3.16.0

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

Vendor (python) PRIMARY 6.3 MEDIUM
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
vuln.today AI 3.7 LOW

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Red Hat 3.7 LOW

Primary rating from Vendor (python).

CVSS VectorVendor: python

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Nov 10, 2026 - 20:20 EUVD
CVE Published
Nov 10, 2026 - 19:19 cve.org
MEDIUM 6.3

DescriptionCVE.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

EPSS Score
0.3%
Top 78% exploitable
Prevalence
High
Python stdlib is ubiquitous, but only imaplib IMAP STARTTLS clients are exposed
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

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

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy