Skip to content

[3.5] closes bpo-38576: Disallow control characters in hostnames in h… #19231

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

Closed
wants to merge 1 commit into from
Closed

Conversation

tapakund
Copy link

@tapakund tapakund commented Mar 30, 2020

…ttp.client.

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

Co-authored-by: Ashwin Ramaswami [email protected]

Signed-off-by: Tapas Kundu [email protected]

https://bugs.python.org/issue38576

The AbstractBasicAuthHandler class of the urllib.request module uses
an inefficient regular expression which can be exploited by an
attacker to cause a denial of service. Fix the regex to prevent the
catastrophic backtracking. Vulnerability reported by Ben Caller
and Matt Schwager.

AbstractBasicAuthHandler of urllib.request now parses all
WWW-Authenticate HTTP headers and accepts multiple challenges per
header: use the realm of the first Basic challenge.

Co-Authored-By: Serhiy Storchaka <[email protected]>

Signed-off-by: Tapas Kundu <[email protected]>
@tapakund
Copy link
Author

tapakund commented Apr 2, 2020

Will raise a fresh PR

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

Successfully merging this pull request may close these issues.

4 participants