BIT-python-min-2025-15366: 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 Software Foundation 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, to prevent additional commands from being injected.

Event History

Jan 20, 2026
CVE Published
via OSV·09:40 PM
Data Sourced
via OSV·09:40 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What must an attacker control to exploit this issue?

The attacker must be able to influence a command passed to imaplib. Newline characters in that command can be used to inject additional IMAP commands.

2

What can be done if an update cannot be applied immediately?

Reject user-controlled commands containing control characters, including newlines, before passing them to imaplib. This is the mitigation described for the issue.

3

How can I assess whether an application is exposed?

Review code paths that construct or pass IMAP commands through imaplib and identify whether any portion of those commands can be controlled by untrusted input. Exposure depends on user-controlled command content reaching the module without control-character rejection.

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