Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islingtonmiss-islington commented Mar 18, 2025

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

…-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>
@miss-islingtonmiss-islington requested a review from a team as a code ownerMarch 18, 2025 11:07
@bitdancerbitdancer merged commit 31767e6 into python:3.13Mar 18, 2025
40 checks passed
@miss-islingtonmiss-islington deleted the backport-295b53d-3.13 branch January 2, 2026 17:43
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.

3 participants

@miss-islington@bitdancer@medmunds