cpython/Lib/email
Brian Schubert d4df3c55e4
[3.9] gh-80222: Fix email address header folding with long quoted-string (GH-122753) (GH-129111) (GH-132371)
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 5aaf416858)
(cherry picked from commit a4ef689ce6)

Co-authored-by: R. David Murray <rdmurray@bitdance.com>
Co-authored-by: Mike Edmunds <medmunds@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-06-02 17:57:06 +02:00
..
mime Issue #27445: Merge from 3.5 2016-09-08 19:42:11 +03:00
__init__.py #22508: Drop email __version__ string. It no longer means anything. 2014-10-03 13:02:47 -04:00
_encoded_words.py bpo-43323: Fix UnicodeEncodeError in the email module (GH-32137) 2022-04-30 05:31:37 -07:00
_header_value_parser.py [3.9] gh-80222: Fix email address header folding with long quoted-string (GH-122753) (GH-129111) (GH-132371) 2025-06-02 17:57:06 +02:00
_parseaddr.py bpo-45239: Fix parsedate_tz when time has more than 2 dots in it (GH-28452) (GH-28928) 2021-10-13 18:58:37 +02:00
_policybase.py [3.9] gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233) (#122610) 2024-09-04 17:39:02 +02:00
architecture.rst Fix typos in multiple `.rst` files (#1668) 2017-05-19 23:37:57 +03:00
base64mime.py Correct misspellings of ISO-8859 2016-08-10 05:25:16 +00:00
charset.py [3.9] gh-77630: Change Charset to charset (GH-92439) (GH-92477) 2022-05-08 08:28:18 -07:00
contentmanager.py [3.9] bpo-45060: Get rid of few uses of the equality operators with None (GH-28087). (GH-28093) 2021-09-01 09:51:01 +03:00
encoders.py #19957: Simplify encode_7or8bit now that _payload is always str. 2013-12-12 21:40:20 -05:00
errors.py [3.9] gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233) (#122610) 2024-09-04 17:39:02 +02:00
feedparser.py bpo-30835: email: Fix AttributeError when parsing invalid CTE (GH-13598) 2019-06-04 11:00:47 -07:00
generator.py [3.9] gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233) (#122610) 2024-09-04 17:39:02 +02:00
header.py bpo-27737: Allow whitespace only headers encoding (#13478) 2019-05-22 21:13:16 -04:00
headerregistry.py bpo-39073: validate Address parts to disallow CRLF (#19007) 2020-03-29 20:38:41 -04:00
iterators.py utilize yield from 2012-10-01 12:53:43 -07:00
message.py bpo-42892: fix email multipart attribute error (GH-26903) (GH-27493) 2021-07-30 19:30:58 +02:00
parser.py Fix infinite loop in email folding logic (GH-12732) 2019-07-16 10:50:01 -07:00
policy.py bpo-33524: Fix the folding of email header when max_line_length is 0 or None (#13391) 2019-05-17 15:28:44 -04:00
quoprimime.py bpo-32297: Few misspellings found in Python source code comments. (#4803) 2017-12-14 13:04:53 +02:00
utils.py [3.9] [CVE-2023-27043] gh-102988: Reject malformed addresses in email.parseaddr() (GH-111116) (#123769) 2024-09-06 13:13:54 +02:00