Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[3.12] gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233)#122599

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Yhg1s merged 2 commits intopython:3.12fromencukou:backport-0976339-3.12
Aug 6, 2024

Conversation

encukou
Copy link
Member

@encukouencukou commentedAug 2, 2024
edited by github-actionsbot
Loading

  • Encode header parts that contain newlines

Per RFC 2047:

[...] these encoding schemes allow the
encoding of arbitrary octet values, mail readers that implement this
decoding should also ensure that display of the decoded data on the
recipient's terminal will not cause unwanted side-effects

It seems that the "quoted-word" scheme is a valid way to include
a newline character in a header value, just like we already allow
undecodable bytes or control characters.
They do need to be properly quoted when serialized to text, though.

  • Verify that email headers are well-formed

This should fail for custom fold() implementations that aren't careful
about newlines.

Co-authored-by: Bas Bloemsaatbas@bloemsaat.org
Co-authored-by: Serhiy Storchakastorchaka@gmail.com
(cherry picked from commit0976339)


📚 Documentation preview 📚:https://cpython-previews--122599.org.readthedocs.build/

encukouand others added2 commitsAugust 2, 2024 11:26
…ound (pythonGH-122233)- Encode header parts that contain newlinesPer RFC 2047:> [...] these encoding schemes allow the> encoding of arbitrary octet values, mail readers that implement this> decoding should also ensure that display of the decoded data on the> recipient's terminal will not cause unwanted side-effectsIt seems that the "quoted-word" scheme is a valid way to includea newline character in a header value, just like we already allowundecodable bytes or control characters.They do need to be properly quoted when serialized to text, though.- Verify that email headers are well-formedThis should fail for custom fold() implementations that aren't carefulabout newlines.Co-authored-by: Bas Bloemsaat <bas@bloemsaat.org>Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>(cherry picked from commit0976339)
@encukou
Copy link
MemberAuthor

Marking this for consideration as a release blocker.
IMO, this should go into 3.12.5. Ideally it would be merged after the3.13 backport, which requires review.

@Yhg1sYhg1s merged commit4766d12 intopython:3.12Aug 6, 2024
31 checks passed
@encukouencukou deleted the backport-0976339-3.12 branchAugust 7, 2024 12:00
smoser added a commit to smoser/advisories that referenced this pull requestAug 8, 2024
The fix for this issue was included in upstream release of 3.12.5.python/cpython#122599
github-merge-queuebot pushed a commit to wolfi-dev/advisories that referenced this pull requestAug 8, 2024
The fix for this issue was included in upstream release of 3.12.5.python/cpython#122599
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@encukou@Yhg1s

[8]ページ先頭

©2009-2025 Movatter.jp