CVE-2025-15366: CWE-77 Improper Neutralization of Special Elements used in a Command ('Command Injection') in Python Software Foundation CPython
The imaplib module, when passed a user-controlled command, can have additional commands injected using newlines. Mitigation rejects commands containing control characters.
AI Analysis
Technical Summary
The imaplib module in CPython allows command injection when it processes user-supplied commands containing newline characters, enabling attackers to inject additional commands. This is due to improper neutralization of special elements (CWE-77). The vulnerability is mitigated by rejecting commands that contain control characters. The affected versions include 0, 3.15.0a1, and 3.14.0. The CVSS 4.0 base score is 5.9, indicating a medium severity vulnerability with network attack vector, low complexity, partial privileges required, no user interaction, and limited confidentiality and high integrity and availability impacts.
Potential Impact
An attacker with partial privileges can inject additional commands into the imaplib module by exploiting newline characters in user-controlled input. This could lead to unauthorized command execution within the context of the affected Python process, potentially impacting integrity and availability. Confidentiality impact is low, and no privilege escalation or user interaction is required.
Mitigation Recommendations
No official patch or fix is currently referenced. Patch status is not yet confirmed — check the Python Software Foundation advisory for current remediation guidance. The known mitigation is to reject commands containing control characters to prevent injection. Users should monitor vendor advisories for updates and apply any forthcoming official fixes.
CVE-2025-15366: CWE-77 Improper Neutralization of Special Elements used in a Command ('Command Injection') in Python Software Foundation CPython
Description
The imaplib module, when passed a user-controlled command, can have additional commands injected using newlines. Mitigation rejects commands containing control characters.
CVSS v4.0
Score 5.9medium
Affected software
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The imaplib module in CPython allows command injection when it processes user-supplied commands containing newline characters, enabling attackers to inject additional commands. This is due to improper neutralization of special elements (CWE-77). The vulnerability is mitigated by rejecting commands that contain control characters. The affected versions include 0, 3.15.0a1, and 3.14.0. The CVSS 4.0 base score is 5.9, indicating a medium severity vulnerability with network attack vector, low complexity, partial privileges required, no user interaction, and limited confidentiality and high integrity and availability impacts.
Potential Impact
An attacker with partial privileges can inject additional commands into the imaplib module by exploiting newline characters in user-controlled input. This could lead to unauthorized command execution within the context of the affected Python process, potentially impacting integrity and availability. Confidentiality impact is low, and no privilege escalation or user interaction is required.
Mitigation Recommendations
No official patch or fix is currently referenced. Patch status is not yet confirmed — check the Python Software Foundation advisory for current remediation guidance. The known mitigation is to reject commands containing control characters to prevent injection. Users should monitor vendor advisories for updates and apply any forthcoming official fixes.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- PSF
- Date Reserved
- 2025-12-30T16:06:41.731Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 696ff8c24623b1157c513cf6
Added to database: 01/20/2026, 21:50:58 UTC
Last enriched: 08/06/2026, 13:11:15 UTC
Last updated: 09/10/2026, 19:36:49 UTC
Views: 504
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.