summaryrefslogtreecommitdiff
path: root/tests
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 19:20:07 -0400
commit011a54315e46acdf288003566b8570440f5ac985 (patch)
tree73e17756bfed3b234c5a499eb1fa9cb75a4084e3 /tests
parent1c83fc88d6928a5ab53bc3dde79dad3cc0bfcfdc (diff)
Made is_safe_url() reject URLs that start with control characters.
This is a security fix; disclosure to follow shortly.
Diffstat (limited to 'tests')
-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 7e48fe70a7..74c6905294 100644
--- a/tests/utils_tests/test_http.py
+++ b/tests/utils_tests/test_http.py
@@ -115,7 +115,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',