Skip to content

[3.13] gh-143921: Reject NUL, CR and LF in IMAP commands (GH-143922, GH-153067) (GH-153137) - #153287

Merged
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-2981822-3.13
Jul 7, 2026
Merged

serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-2981822-3.13

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

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 2981822)

Co-authored-by: Seth Michael Larson [email protected]
Co-authored-by: Claude Fable 5 [email protected]

…nGH-143922, pythonGH-153067) (pythonGH-153137)

Combined backport of pythonGH-143922, which rejected all control characters,
and pythonGH-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 6262704)
(cherry picked from commit d0921ef)
(cherry picked from commit 2981822)

Co-authored-by: Seth Michael Larson <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
@serhiy-storchaka
serhiy-storchaka requested a review from a team as a code owner July 7, 2026 17:41
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) July 7, 2026 17:53
@serhiy-storchaka
serhiy-storchaka merged commit 71926d9 into python:3.13 Jul 7, 2026
74 of 76 checks passed
@serhiy-storchaka
serhiy-storchaka deleted the backport-2981822-3.13 branch July 15, 2026 11:50
icanhasmath pushed a commit to ActiveState/cpython that referenced this pull request Oct 28, 2026
…nGH-143922, pythonGH-153067) (pythonGH-153137) (pythonGH-153287)

Combined backport of pythonGH-143922, which rejected all control characters,
and pythonGH-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 6262704)
(cherry picked from commit d0921ef)
(cherry picked from commit 2981822)

Co-authored-by: Seth Michael Larson <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
(cherry picked from commit 71926d9)

3.10.22.x: 3.10 has no IMAP argument quoting (the _non_astring_char /
_quoted machinery is 3.13+), so only the NUL/CR/LF rejection is ported.
The test keeps the rejection check and checks that other control
characters are still accepted, without the 3.13 quoting assertion.
icanhasmath pushed a commit to ActiveState/cpython that referenced this pull request Oct 28, 2026
…nGH-143922, pythonGH-153067) (pythonGH-153137) (pythonGH-153287)

Combined backport of pythonGH-143922, which rejected all control characters,
and pythonGH-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 6262704)
(cherry picked from commit d0921ef)
(cherry picked from commit 2981822)

Co-authored-by: Seth Michael Larson <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
(cherry picked from commit 71926d9)

3.10.22.x: 3.10 has no IMAP argument quoting (the _non_astring_char /
_quoted machinery is 3.13+), so only the NUL/CR/LF rejection is ported.
The test keeps the rejection check and checks that other control
characters are still accepted, without the 3.13 quoting assertion.

(cherry picked from commit c1d1d62)
icanhasmath pushed a commit to ActiveState/cpython that referenced this pull request Oct 28, 2026
…nGH-143922, pythonGH-153067) (pythonGH-153137) (pythonGH-153287)

Combined backport of pythonGH-143922, which rejected all control characters,
and pythonGH-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 6262704)
(cherry picked from commit d0921ef)
(cherry picked from commit 2981822)

Co-authored-by: Seth Michael Larson <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
(cherry picked from commit 71926d9)

3.10.22.x: 3.10 has no IMAP argument quoting (the _non_astring_char /
_quoted machinery is 3.13+), so only the NUL/CR/LF rejection is ported.
The test keeps the rejection check and checks that other control
characters are still accepted, without the 3.13 quoting assertion.
icanhasmath pushed a commit to ActiveState/cpython that referenced this pull request Oct 28, 2026
…nGH-143922, pythonGH-153067) (pythonGH-153137) (pythonGH-153287)

Combined backport of pythonGH-143922, which rejected all control characters,
and pythonGH-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 6262704)
(cherry picked from commit d0921ef)
(cherry picked from commit 2981822)

Co-authored-by: Seth Michael Larson <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
(cherry picked from commit 71926d9)

3.10.22.x: 3.10 has no IMAP argument quoting (the _non_astring_char /
_quoted machinery is 3.13+), so only the NUL/CR/LF rejection is ported.
The test keeps the rejection check and checks that other control
characters are still accepted, without the 3.13 quoting assertion.

(cherry picked from commit c1d1d62)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant