]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] 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:06:28 +0000 (22:06 +0100)
committerGitHub <noreply@github.com>
Sun, 19 Jan 2025 21:06:28 +0000 (16:06 -0500)
commit21200895478b8076fc0bda6ee2c26f0d87c9404b
tree8239bae5da3a69e47f17e46643d69da0d5b85ba7
parent6b47499510e47c0401d1f6cca2660fc12c496e39
[3.13] gh-80222: Fix email address header folding with long quoted-string (GH-122753) (#129007)

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]