summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_http.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-03-09 20:05:13 -0400
committerTim Graham <timograham@gmail.com>2015-03-18 08:51:51 -0400
commit2a4113dbd532ce952308992633d802dc169a75f1 (patch)
treeeb181541ed077c28ce423c94a97e7589f16e5632 /tests/utils_tests/test_http.py
parente63363f8e075fa8d66326ad6a1cc3391cc95cd97 (diff)
[1.7.x] Made is_safe_url() reject URLs that start with control characters.
This is a security fix; disclosure to follow shortly.
Diffstat (limited to 'tests/utils_tests/test_http.py')
-rw-r--r--tests/utils_tests/test_http.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/utils_tests/test_http.py b/tests/utils_tests/test_http.py
index 3b3083baf0..3b367a4952 100644
--- a/tests/utils_tests/test_http.py
+++ b/tests/utils_tests/test_http.py
@@ -108,7 +108,9 @@ class TestUtilsHttp(unittest.TestCase):
'http:\/example.com',
'http:/\example.com',
'javascript:alert("XSS")',
- '\njavascript:alert(x)'):
+ '\njavascript:alert(x)',
+ '\x08//example.com',
+ '\n'):
self.assertFalse(http.is_safe_url(bad_url, host='testserver'), "%s should be blocked" % bad_url)
for good_url in ('/view/?param=http://example.com',
'/view/?param=https://example.com',