◐ Shell
clean mode source ↗

[3.5] closes bpo-38576: Disallow control characters in hostnames in h… by tapakund · Pull Request #19231 · python/cpython

@tapakund

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 <storchaka@gmail.com>

Signed-off-by: Tapas Kundu <tkundu@vmware.com>