File CVE-2021-3733-fix-ReDoS-in-request.patch of Package python (Revision 381d91ea0ab10fc5235c75951d42564a)
Currently displaying revision 381d91ea0ab10fc5235c75951d42564a , Show latest
16
1
--- a/Lib/urllib2.py
2
+++ b/Lib/urllib2.py
3
4
5
# allow for double- and single-quoted realm values
6
# (single quotes are a violation of the RFC, but appear in the wild)
7
- rx = re.compile('(?:[^,]*,)*[ \t]*([^ \t]+)[ \t]+'
8
+ rx = re.compile('(?:[^,]*,)*[ \t]*([^ \t,]+)[ \t]+'
9
'realm=(["\']?)([^"\']*)\\2', re.I)
10
11
# XXX could pre-emptively send auth info already accepted (RFC 2617,
12
--- /dev/null
13
+++ b/Misc/NEWS.d/next/Security/2021-01-31-05-28-14.bpo-43075.DoAXqO.rst
14
15
+Fix Regular Expression Denial of Service (ReDoS) vulnerability in :class:`urllib.request.AbstractBasicAuthHandler`. The ReDoS-vulnerable regex has quadratic worst-case complexity and it allows cause a denial of service when identifying crafted invalid RFCs. This ReDoS issue is on the client side and needs remote attackers to control the HTTP server.
16