gh-142533: Document CRLF injection vulnerability in http.server and wsgiref modules#143395
Open
tadejmagajna wants to merge 4 commits intopython:mainfrom
Open
gh-142533: Document CRLF injection vulnerability in http.server and wsgiref modules#143395tadejmagajna wants to merge 4 commits intopython:mainfrom
tadejmagajna wants to merge 4 commits intopython:mainfrom
Conversation
… and wsgiref modules
Member
|
Hi, according to the Dev Guide, the document only changes don't need a news entry file. |
picnixz
reviewed
Jan 4, 2026
Doc/library/http.server.rst
Outdated
Comment on lines
290
to
292
| This method does not reject input containing CRLF sequences allowing the | ||
| possibility of CRLF injection, where a single method call can inject | ||
| multiple arbitrary headers. |
Member
There was a problem hiding this comment.
Suggested change
| This method does not reject input containing CRLF sequences allowing the | |
| possibility of CRLF injection, where a single method call can inject | |
| multiple arbitrary headers. | |
| This method does not reject input containing CRLF sequences. |
Only mention the possibility of CRLF injection in the security consideration section.
Contributor
Author
There was a problem hiding this comment.
Thank you for the suggestion. Addressed for both modules
Doc/library/wsgiref.rst
Outdated
Comment on lines
266
to
268
| This method does not reject input containing CRLF sequences allowing the | ||
| possibility of CRLF injection, where a single method call can inject | ||
| multiple arbitrary headers. |
picnixz
reviewed
Jan 4, 2026
Comment on lines
+900
to
+901
| Security considerations | ||
| ----------------------- |
Member
There was a problem hiding this comment.
Please format this the same as we did for Http.server, that is: add a label and enough blank lines.
Contributor
Author
|
@picnixz thank you for the suggestions. I believe this is addressed now. |
picnixz
approved these changes
Jan 19, 2026
Member
|
cc @SethMichaelLarson @gpshead @serhiy-storchaka: Do you want to double check this change? |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change documents the CRLF injection vulnerability for http headers in
http.serverandwsgirefmodules.Initial report in #142533 focused on
http.serveronly, though further discussion suggested also addressing a closely related vulnerability inwsgirefreferenced in related issues #55880 and #72964.After discussing #142605, we pivoted from a direct fix to a documentation update because a fix would disrupt users who rely on using the vulnerability for non-malicious purposes.
The change documents the low-level vulnerability (i.e. absence of checking for CRLF) in mehod-specific sections while describing the high level implications (i.e. assuming sanitized input) under the "Security considerations" section.
http.server#142533📚 Documentation preview 📚: https://cpython-previews--143395.org.readthedocs.build/