BIT-libpython-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 imaplib

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    Reject IMAP commands containing control characters, including newlines, before passing user-controlled commands to the imaplib module.

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 are exposed when they pass user-controlled values as IMAP commands through Python's imaplib module. Code that does not allow an attacker to influence the command is not described as affected.

2

What does an attacker need to exploit this issue?

An attacker needs control over an IMAP command value supplied to imaplib and must be able to include newline or other control characters. Those characters can be used to inject additional IMAP commands.

3

What can be done if the mitigation is not yet deployed?

Do not pass untrusted input directly as an IMAP command. Reject command values containing control characters, including newlines, before they reach imaplib.

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