]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-143921: Reject NUL, CR and LF in IMAP commands (GH-143922, GH-153067) ...
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 7 Jul 2026 17:13:02 +0000 (20:13 +0300)
committerGitHub <noreply@github.com>
Tue, 7 Jul 2026 17:13:02 +0000 (20:13 +0300)
commit298182272a740ce2016aee2f54acbd0bba1944c1
tree0f4593b796c7e67f6f76d45b3293206787e3a13a
parent406208a1e277539fef370c738d48e89b84c1c993
[3.14] gh-143921: Reject NUL, CR and LF in IMAP commands (GH-143922, GH-153067) (GH-153137)

Combined backport of GH-143922, which rejected all control characters,
and GH-153067, which narrowed the check to NUL, CR and LF.  Other
control characters are valid in quoted strings and are sent quoted.

(cherry picked from commit 6262704b134db2a4ba12e85ecfbd968534f28b45)
(cherry picked from commit d0921efb665aff26b378f495e5ff84f7e3fe649d)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Lib/imaplib.py
Lib/test/test_imaplib.py
Misc/NEWS.d/next/Security/2026-01-16-11-41-06.gh-issue-143921.AeCOor.rst [new file with mode: 0644]