mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
[1.8.x] Fixed catastrophic backtracking in URLValidator.
Thanks João Silva for reporting the problem and Tim Graham for finding the problematic RE and for review. This is a security fix; disclosure to follow shortly.
This commit is contained in:
@@ -35,6 +35,8 @@ http://foo.bar/foo(bar)baz quux
|
||||
http://-error-.invalid/
|
||||
http://-a.b.co
|
||||
http://a.b-.co
|
||||
http://a.-b.co
|
||||
http://a.b-.c.co
|
||||
http:/
|
||||
http://
|
||||
http://
|
||||
|
||||
@@ -172,6 +172,9 @@ TEST_DATA = [
|
||||
# Trailing newlines not accepted
|
||||
(URLValidator(), 'http://www.djangoproject.com/\n', ValidationError),
|
||||
(URLValidator(), 'http://[::ffff:192.9.5.5]\n', ValidationError),
|
||||
# Trailing junk does not take forever to reject
|
||||
(URLValidator(), 'http://www.asdasdasdasdsadfm.com.br ', ValidationError),
|
||||
(URLValidator(), 'http://www.asdasdasdasdsadfm.com.br z', ValidationError),
|
||||
|
||||
(BaseValidator(True), True, None),
|
||||
(BaseValidator(True), False, ValidationError),
|
||||
|
||||
@@ -7,6 +7,7 @@ http://www.example.com/
|
||||
http://www.example.com:8000/test
|
||||
http://valid-with-hyphens.com/
|
||||
http://subdomain.example.com/
|
||||
http://a.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
http://200.8.9.10/
|
||||
http://200.8.9.10:8000/test
|
||||
http://su--b.valid-----hyphens.com/
|
||||
|
||||
Reference in New Issue
Block a user