Skip to content

Conversation

@tadejmagajna
Copy link
Contributor

@tadejmagajna tadejmagajna commented Jan 3, 2026

This change documents the CRLF injection vulnerability for http headers in http.server and wsgiref modules.

Initial report in #142533 focused on http.server only, though further discussion suggested also addressing a closely related vulnerability in wsgiref referenced 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.


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

@bedevere-app bedevere-app bot added awaiting review docs Documentation in the Doc dir labels Jan 3, 2026
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Jan 3, 2026
@picnixz picnixz self-requested a review January 4, 2026 01:15
@aisk
Copy link
Contributor

aisk commented Jan 4, 2026

Hi, according to the Dev Guide, the document only changes don't need a news entry file.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the suggestion. Addressed for both modules

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Comment on lines +900 to +901
Security considerations
-----------------------
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format this the same as we did for Http.server, that is: add a label and enough blank lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants