]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-80222: Fix email address header folding with long quoted-string (GH-122753...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 19 Jan 2025 21:07:39 +0000 (22:07 +0100)
committerGitHub <noreply@github.com>
Sun, 19 Jan 2025 21:07:39 +0000 (16:07 -0500)
commitb8170e58849a7728ebc9b58e222aa5bd051cf7c4
tree1293360d0c6e825eab0fd1677e273aa6a2917855
parentfceb8c31ddf8db2fddd92c8c6437094081c91ac8
[3.12] gh-80222: Fix email address header folding with long quoted-string (GH-122753) (#129008)

gh-80222: Fix email address header folding with long quoted-string (GH-122753)

Email generators using email.policy.default could incorrectly omit the
quote ('"') characters from a quoted-string during header refolding,
leading to invalid address headers and enabling header spoofing. This
change restores the quote characters on a bare-quoted-string as the
header is refolded, and escapes backslash and quote chars in the string.
(cherry picked from commit 5aaf41685834901e4ed0a40f4c055b92991a0bb5)

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
Lib/email/_header_value_parser.py
Lib/test/test_email/test__header_value_parser.py
Misc/NEWS.d/next/Security/2024-08-06-11-43-08.gh-issue-80222.wfR4BU.rst [new file with mode: 0644]