PSF-2026-3: IMAP command injection in user-controlled commands
Published Jan 20, 2026
·Updated
The imaplib module, when passed a user-controlled command, can have additional commands injected using newlines. Mitigation rejects commands containing control characters.
Affected Software
1 affected component
Python imaplib
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Reject user-controlled IMAP commands that contain control characters, including newlines.
Event History
Jan 20, 2026
CVE Published
via OSV·09:40 PM
Data Sourced
via OSV·09:40 PM
DescriptionSeverityWeakness
Frequently Asked Questions
1
Which applications are exposed?
Applications using Python's imaplib are exposed if they pass user-controlled data as an IMAP command. The issue arises when that data can include newlines.
2
What must an attacker control to exploit this?
An attacker needs to influence the command passed to imaplib and supply a newline, allowing additional IMAP commands to be injected.
3
How is the issue mitigated?
The mitigation rejects commands containing control characters, which prevents newline-based command injection.