summaryrefslogtreecommitdiff
path: root/tests/validators/tests.py
diff options
context:
space:
mode:
authorShai Berger <shai@platonix.com>2015-06-30 01:09:21 +0300
committerTim Graham <timograham@gmail.com>2015-07-08 15:23:19 -0400
commit8f9a4d3a2bc42f14bb437defd30c7315adbff22c (patch)
tree00552e5bf72b45186b14aadc17aa63e2073e6617 /tests/validators/tests.py
parent574dd5e0b0fbb877ae5827b1603d298edc9bb2a0 (diff)
[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.
Diffstat (limited to 'tests/validators/tests.py')
-rw-r--r--tests/validators/tests.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/validators/tests.py b/tests/validators/tests.py
index e410905b50..528b1a74ca 100644
--- a/tests/validators/tests.py
+++ b/tests/validators/tests.py
@@ -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),