]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-80222: Fix email address header folding with long quoted-string (#122753)
authorMike Edmunds <medmunds@gmail.com>
Sun, 19 Jan 2025 00:50:52 +0000 (16:50 -0800)
committerGitHub <noreply@github.com>
Sun, 19 Jan 2025 00:50:52 +0000 (19:50 -0500)
commit5aaf41685834901e4ed0a40f4c055b92991a0bb5
tree82b4dd8aa0c225c2db38853fb8d1592d6db9f2cd
parent61b35f74aa4a6ac606635e245147ff3658628d99
gh-80222: Fix email address header folding with long quoted-string (#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.
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]