What’s Vulnerable › Vulnerabilities
CVE-2025-15366: IMAP command injection in user-controlled commands
- Severity: medium (CVSS 5.9 v4.0)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.4% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2026-01-20 · updated 2026-08-06
- Weakness: CWE-77
Description
The imaplib module, when passed a user-controlled command, can have additional commands injected using newlines. Mitigation rejects commands containing control characters.
Affected products
- Python: before 3.13.15; from 3.14.0 before 3.14.7; from 3.15.0a1 before 3.15.0a6 — fixed in 3.13.15, 3.14.7, 3.15.0a6
How to fix
Upgrade to a fixed version: Python 3.13.15, 3.14.7, 3.15.0a6. Check the vendor advisory for mitigations.
References
- https://github.com/python/cpython/commit/298182272a740ce2016aee2f54acbd0bba1944c1
- https://github.com/python/cpython/commit/6262704b134db2a4ba12e85ecfbd968534f28b45
- https://github.com/python/cpython/commit/71926d943c05bde79bd2a866933103541d91b6a2
- https://github.com/python/cpython/commit/d0921efb665aff26b378f495e5ff84f7e3fe649d
- https://github.com/python/cpython/commit/f2cd7ef89aa8a0dcbc7283bbd39548b76f2a736a
- https://github.com/python/cpython/issues/143921
- https://github.com/python/cpython/pull/143922
- https://mail.python.org/archives/list/security-announce@python.org/thread/DD7C7JZJYTBXMDOWKCEIEBJLBRU64OMR/
Get alerted when CVE-2025-15366 or the next vulnerability affects your stack