Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.10] gh-143935: Email preserve parens when folding comments (GH-143936)#144350

Merged
pablogsal merged 1 commit into
python:3.10python/cpython:3.10from
edgarrmondragon:backport-17d1490-3.10edgarrmondragon/cpython:backport-17d1490-3.10Copy head branch name to clipboard
Mar 2, 2026
Merged

[3.10] gh-143935: Email preserve parens when folding comments (GH-143936)#144350
pablogsal merged 1 commit into
python:3.10python/cpython:3.10from
edgarrmondragon:backport-17d1490-3.10edgarrmondragon/cpython:backport-17d1490-3.10Copy head branch name to clipboard

Conversation

@edgarrmondragon

@edgarrmondragon edgarrmondragon commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

Fix a bug in the folding of comments when flattening an email message using a modern email policy. Comments consisting of a very long sequence of non-foldable characters could trigger a forced line wrap that omitted the required leading space on the continuation line, causing the remainder of the comment to be interpreted as a new header field. This enabled header injection with carefully crafted inputs.
(cherry picked from commit 17d1490)

Co-authored-by: Seth Michael Larson seth@python.org
Co-authored-by: Denis Ledoux dle@odoo.com

@edgarrmondragon

Copy link
Copy Markdown
Contributor Author

would you mind taking a look @sethmlarson?

…ythonGH-143936)

Fix a bug in the folding of comments when flattening an email message
using a modern email policy. Comments consisting of a very long sequence of
non-foldable characters could trigger a forced line wrap that omitted the
required leading space on the continuation line, causing the remainder of
the comment to be interpreted as a new header field. This enabled header
injection with carefully crafted inputs.
(cherry picked from commit 17d1490)

Co-authored-by: Seth Michael Larson seth@python.org
Co-authored-by: Denis Ledoux dle@odoo.com

- Issue: Fix folding of long comments of unfoldable characters in email headers python#143935

Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
@pablogsal pablogsal merged commit 003b831 into python:3.10 Mar 2, 2026
15 checks passed
@edgarrmondragon edgarrmondragon deleted the backport-17d1490-3.10 branch March 3, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.