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.3] bpo-22928: Disabled HTTP header injections in http.client.#2817

Merged
ned-deily merged 2 commits into
python:3.3python/cpython:3.3from
serhiy-storchaka:backport-a112a8a-3.3serhiy-storchaka/cpython:backport-a112a8a-3.3Copy head branch name to clipboard
Jul 26, 2017
Merged

[3.3] bpo-22928: Disabled HTTP header injections in http.client.#2817
ned-deily merged 2 commits into
python:3.3python/cpython:3.3from
serhiy-storchaka:backport-a112a8a-3.3serhiy-storchaka/cpython:backport-a112a8a-3.3Copy head branch name to clipboard

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 22, 2017

Copy link
Copy Markdown
Member

Original patch by Demian Brecht.
(cherry picked from commit a112a8a)

https://bugs.python.org/issue22928

…lient.

Original patch by Demian Brecht..
(cherry picked from commit a112a8a)
@mention-bot

Copy link
Copy Markdown

@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @pitrou, @gvanrossum and @orsenthil to be potential reviewers.

@vstinner

Copy link
Copy Markdown
Member

See my comment on the bpo: http://bugs.python.org/issue22928#msg299053

Comment thread Lib/http/client.py

# the patterns for both name and value are more leniant than RFC
# definitions to allow for backwards compatibility
_is_legal_header_name = re.compile(rb'[^:\s][^:\r\n]*\Z').match

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Python 2.7 regex starts with \A. Is it useful?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No. match() always matches from the start.

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@ned-deily ned-deily merged commit 8e88f6b into python:3.3 Jul 26, 2017
@serhiy-storchaka serhiy-storchaka deleted the backport-a112a8a-3.3 branch August 9, 2017 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-security A security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

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