File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,13 @@ def test_http2time_garbage(self):
123
123
"http2time(%s) is not None\n "
124
124
"http2time(test) %s" % (test , http2time (test )))
125
125
126
+ def test_http2time_redos_regression_actually_completes (self ):
127
+ # LOOSE_HTTP_DATE_RE was vulnerable to malicious input which caused catastrophic backtracking (REDoS).
128
+ # If we regress to cubic complexity, this test will take a very long time to succeed.
129
+ # If fixed, it should complete within a fraction of a second.
130
+ http2time ("01 Jan 1970{}00:00:00 GMT!" .format (" " * 10 ** 5 ))
131
+ http2time ("01 Jan 1970 00:00:00{}GMT!" .format (" " * 10 ** 5 ))
132
+
126
133
def test_iso2time (self ):
127
134
def parse_date (text ):
128
135
return time .gmtime (iso2time (text ))[:6 ]
You can’t perform that action at this time.
0 commit comments