]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-80222: Fix email address header folding with long quoted-string (GH-122753...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 19 Feb 2025 13:12:34 +0000 (14:12 +0100)
committerGitHub <noreply@github.com>
Wed, 19 Feb 2025 13:12:34 +0000 (14:12 +0100)
commit7cff053efeb8506495c5f77f40742341a1714d96
treebfb8111a5900e68fd0befda67c0e49011f862918
parent9d727fe7396f9d745c84ee81951cecab442eb34e
[3.11] gh-80222: Fix email address header folding with long quoted-string (GH-122753) (#129009)

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>
Co-authored-by: Petr Viktorin <encukou@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]