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.

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

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203