CVE-2025-15366
cpython: IMAP command injection in user-controlled commands
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · January 21, 2026
Updated · May 12, 2026
Description
A flaw was found in the imaplib module in the Python standard library. The imaplib module does not reject control characters, such as newlines, in user-controlled input passed to IMAP commands. This issue allows an attacker to inject additional commands to be executed in the IMAP server.
Statement
To exploit this issue, an attacker needs to have the privileges required to send malicious input to an application that sends IMAP commands to a server. Additionally, this flaw can allow attackers to manipulate the state of the mailbox (e.g., delete emails, move folders, flag messages) and to potentially read metadata or specific email content, but it does not allow arbitrary code execution or OS command injection. Due to these reasons, this issue has been rated with a moderate severity.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
To mitigate this vulnerability, ensure that no data passed to the imaplib module contains newline or carriage return characters.
CVSS / CWE
CVSS 3.1 · 7.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N
CWE-77 · Improper Neutralization of Special Elements used in a Command ('Command Injection')