Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-38576: Disallow control characters in hostnames in http.client #18995

Merged
merged 2 commits into from
Mar 14, 2020

Conversation

epicfaace
Copy link
Contributor

@epicfaace epicfaace commented Mar 14, 2020

Extends #12755 to apply to hostnames.

https://bugs.python.org/issue38576

@gpshead gpshead self-assigned this Mar 14, 2020
@gpshead gpshead added needs backport to 3.6 type-bug An unexpected behavior, bug, or error type-security A security issue labels Mar 14, 2020
@gpshead
Copy link
Member

gpshead commented Mar 14, 2020

Thanks!

While reviewing I also looked over the _get_hostport(host, port) call that happens before _validate_host(host). I do not believe that will cause any problems, the validation is still doing the right thing even if that transformed host to extract a port number.

@gpshead gpshead merged commit 9165add into python:master Mar 14, 2020
@miss-islington
Copy link
Contributor

Thanks @epicfaace for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7, 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 14, 2020
…ythonGH-18995)

Add host validation for control characters for more CVE-2019-18348 protection.
(cherry picked from commit 9165add)

Co-authored-by: Ashwin Ramaswami <[email protected]>
@bedevere-bot
Copy link

GH-19000 is a backport of this pull request to the 3.8 branch.

@bedevere-bot
Copy link

GH-19001 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 14, 2020
…ythonGH-18995)

Add host validation for control characters for more CVE-2019-18348 protection.
(cherry picked from commit 9165add)

Co-authored-by: Ashwin Ramaswami <[email protected]>
@bedevere-bot
Copy link

GH-19002 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 14, 2020
…ythonGH-18995)

Add host validation for control characters for more CVE-2019-18348 protection.
(cherry picked from commit 9165add)

Co-authored-by: Ashwin Ramaswami <[email protected]>
miss-islington added a commit that referenced this pull request Mar 14, 2020
…H-18995)

Add host validation for control characters for more CVE-2019-18348 protection.
(cherry picked from commit 9165add)

Co-authored-by: Ashwin Ramaswami <[email protected]>
miss-islington added a commit that referenced this pull request Mar 14, 2020
…H-18995)

Add host validation for control characters for more CVE-2019-18348 protection.
(cherry picked from commit 9165add)

Co-authored-by: Ashwin Ramaswami <[email protected]>
@epicfaace epicfaace deleted the url branch March 14, 2020 20:09
ned-deily pushed a commit that referenced this pull request Mar 14, 2020
…H-18995) (GH-19002)

Add host validation for control characters for more CVE-2019-18348 protection.
(cherry picked from commit 9165add)

Co-authored-by: Ashwin Ramaswami <[email protected]>
@tapakund
Copy link

#19231 is a back port of this PR to 3.5 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error type-security A security issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants