[3.9] gh-121284: Fix email address header folding with parsed encoded-word (GH-122754) by encukou · Pull Request #131412 · python/cpython (original) (raw)

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation0 Commits1 Checks9 Files changed

Conversation

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

[ Show hidden characters]({{ revealButtonHref }})

encukou

Member

@encukou encukou commented

Mar 18, 2025

edited by bedevere-appbot

Loading

Email generators using email.policy.default may convert an RFC 2047 encoded-word to unencoded form during header refolding. In a structured header, this could allow 'specials' chars outside a quoted-string, leading to invalid address headers and enabling spoofing. This change ensures a parsed encoded-word that contains specials is kept as an encoded-word while the header is refolded.

[Better fix from @bitdancer.]


(cherry picked from commit 295b53d)

…ncoded-word (pythonGH-122754)

Email generators using email.policy.default may convert an RFC 2047 encoded-word to unencoded form during header refolding. In a structured header, this could allow 'specials' chars outside a quoted-string, leading to invalid address headers and enabling spoofing. This change ensures a parsed encoded-word that contains specials is kept as an encoded-word while the header is refolded.

[Better fix from @bitdancer.]


(cherry picked from commit 295b53d)

Co-authored-by: Mike Edmunds medmunds@gmail.com Co-authored-by: R David Murray rdmurray@bitdance.com Co-authored-by: Petr Viktorin encukou@gmail.com

bitdancer

gentoo-bot pushed a commit to gentoo/cpython that referenced this pull request

Apr 9, 2025

…ncoded-word (pythonGH-122754) (pythonGH-131412)

Email generators using email.policy.default may convert an RFC 2047 encoded-word to unencoded form during header refolding. In a structured header, this could allow 'specials' chars outside a quoted-string, leading to invalid address headers and enabling spoofing. This change ensures a parsed encoded-word that contains specials is kept as an encoded-word while the header is refolded.

[Better fix from @bitdancer.]

(cherry picked from commit 295b53d)

Co-authored-by: Mike Edmunds medmunds@gmail.com Co-authored-by: R David Murray rdmurray@bitdance.com