CVE-2025-15366: IMAP command injection in user-controlled commands
The imaplib module, when passed a user-controlled command, can have additional commands injected using newlines. Mitigation rejects commands containing control characters.
Security readout for executives and security teams
Plain-English summary
This issue affects Python applications only when they let a user influence the IMAP command sent through imaplib. Newline characters can inject extra IMAP commands. Business impact is moderate because exploitation needs a specific unsafe integration pattern and high privileges, but affected mail-processing systems should be reviewed promptly.
Executive priority
Treat as a targeted remediation item, not an emergency. Prioritize systems where users, tenants, or integrations can influence mail commands. Patch or add input rejection once Python’s affected-version guidance is confirmed.
Technical view
CVE-2025-15366 is CWE-77 command injection in CPython imaplib. If a user-controlled command contains newlines, additional IMAP commands may be injected. The stated mitigation is rejecting commands containing control characters. CVSS 4.0 score is 5.9 with network attack vector, low complexity, prerequisite conditions, high privileges, and high integrity impact.
Likely exposure
Exposure appears limited to CPython applications using imaplib and passing user-controlled values as IMAP command names. The bundle does not provide clear affected release ranges; it lists CPython with default status unaffected and patch references, so version mapping should be confirmed from Python guidance.
Exploitation context
The source bundle does not cite active exploitation, and KEV is false. Exploitation requires a vulnerable application design where an already highly privileged actor can supply command text that reaches imaplib as a command and includes control characters.
Researcher notes
The key exposure question is data flow into imaplib command parameters. The bundle supports command-injection risk and control-character rejection as mitigation, but does not clearly identify affected CPython release ranges or exploitation in the wild.
Mitigation direction
Review the Python advisory for fixed release and branch mapping.
Apply CPython updates containing the referenced imaplib patches.
Stop passing user-controlled values as IMAP command names.
Reject control characters before any value reaches imaplib command handling.
Prioritize mail automation, gateways, and admin tools using imaplib.
Validation and detection
Inventory Python services that import or wrap imaplib.
Search for imaplib calls where command names are variable or user-influenced.
Confirm runtime Python versions against the vendor advisory and patch commits.
Add regression tests for newline and control-character rejection.
Review logs for anomalous IMAP command sequences if exposure is confirmed.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-77: Command execution behavior lookup
Command injection weaknesses can lead defenders to review execution techniques and command interpreter telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
1ADP providers
9Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-77 · source CWE mapping
Improper Neutralization of Special Elements used in a Command ('Command Injection')
Improper Neutralization of Special Elements used in a Command ('Command Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.