]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.10] gh-80222: Fix email address header folding with long quoted-string (GH-122753...
authorR. David Murray <rdmurray@bitdance.com>
Thu, 3 Apr 2025 16:58:22 +0000 (12:58 -0400)
committerGitHub <noreply@github.com>
Thu, 3 Apr 2025 16:58:22 +0000 (18:58 +0200)
commita4ef689ce670684ec132204b1cd03720c8e0a03d
tree9d8e48dc4ffb3960f95cb0922a5794263dd6bae3
parentcfaee20d7eaa1442c1a22ef695e60ac5660bfecd
[3.10] gh-80222: Fix email address header folding with long quoted-string (GH-122753) (GH-129111)

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 5aaf4168583)

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
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]