FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.10] gh-80222: Fix email address header folding with long quoted-string (GH-122753) by bitdancer · Pull Request #129111 · python/cpython · GitHub

/ cpython Public

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

Merged
ambv merged 3 commits into
python:3.10from
bitdancer:backport-5aaf416-3.10
Apr 3, 2025
Merged

[3.10] gh-80222: Fix email address header folding with long quoted-string (GH-122753)#129111
ambv merged 3 commits into
python:3.10from
bitdancer:backport-5aaf416-3.10

Conversation

bitdancer commented Jan 21, 2025
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

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

hugovk commented Feb 17, 2025

Copy link
Copy Markdown
Member

@bitdancer The CI is failing for test_email, please could you check it?

Copy link
Copy Markdown
Member

bitdancer is no longer active. @python/email-team Security backport is pending fix of failing test.

Copy link
Copy Markdown
Contributor

The failing test_address_list_with_list_separator_after_fold was added in 3.11 by PRs #100885 and #119099 as a fix for gh-100884 (and regression gh-118643). The test case is being pulled into 3.10 by this backport, but without the corresponding fix.

gh-100884 has similar security implications to the original issue here, but was not identified as a security issue at the time. (It's also effectively the inverse issue of gh-121284.)

Copy link
Copy Markdown
Member Author

@terryjreedy Actually I'm becoming active again, but I'm still ramping back up. I'm still learning about the current way backports are done, and it has taken me a while to get back to this.

medmunds and others added 2 commits March 14, 2025 12:53
…ted-string (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>
bitdancer force-pushed the backport-5aaf416-3.10 branch from 54443ce to f35f5c0 Compare March 14, 2025 16:56

Copy link
Copy Markdown
Member Author

Tests are passing now.

ambv merged commit a4ef689 into python:3.10 Apr 3, 2025

bedevere-app Bot commented Apr 10, 2025

Copy link
Copy Markdown

GH-132371 is a backport of this pull request to the 3.9 branch.

Copy link
Copy Markdown
Member

@bitdancer Good to see you back ;-). Are you aware of core-dev discord?

Copy link
Copy Markdown
Member Author

@terryjreedy Aware, yes, but I haven't gotten around to trying to figure out how to access it ;)

Copy link
Copy Markdown
Member

Once you have an account, I believe you need an invite from an admin. @hugovk @ambv ?

hugovk commented Apr 10, 2025

Copy link
Copy Markdown
Member

@bitdancer I've sent an invite to the email on your profile. Welcome!

ambv added a commit that referenced this pull request Jun 2, 2025
…ing (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 5aaf416)
(cherry picked from commit a4ef689)

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>
bitdancer deleted the backport-5aaf416-3.10 branch November 2, 2025 20:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL