Skip to content

[3.11] gh-80222: Fix email address header folding with long quoted-string (GH-122753) - #129009

Merged
ambv merged 2 commits into
python:3.11from
miss-islington:backport-5aaf416-3.11
Feb 19, 2025
Merged

[3.11] gh-80222: Fix email address header folding with long quoted-string (GH-122753)#129009
ambv merged 2 commits into
python:3.11from
miss-islington:backport-5aaf416-3.11

Conversation

@miss-islington

@miss-islingtonmiss-islington commented Jan 19, 2025

Copy link
Copy Markdown
Contributor

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

Co-authored-by: Mike Edmunds medmunds@gmail.com

…ing (pythonGH-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 5aaf416)
Co-authored-by: Mike Edmunds <medmunds@gmail.com>
@terryjreedy

Copy link
Copy Markdown
Member

@hugovk Unlike the 3.10 backport, this is ready.

@ambv
ambv merged commit 7cff053 into python:3.11Feb 19, 2025
@miss-islington
miss-islington deleted the backport-5aaf416-3.11 branch January 2, 2026 16:48
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-emailtype-securityA security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@miss-islington@terryjreedy@ambv@medmunds@encukou