mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed is_safe_url() to handle leading whitespace.
This is a security fix. Disclosure following shortly.
This commit is contained in:
parent
316b8d4974
commit
69b5e66738
5 changed files with 45 additions and 1 deletions
|
@ -109,7 +109,8 @@ class TestUtilsHttp(unittest.TestCase):
|
|||
'http:/\//example.com',
|
||||
'http:\/example.com',
|
||||
'http:/\example.com',
|
||||
'javascript:alert("XSS")'):
|
||||
'javascript:alert("XSS")',
|
||||
'\njavascript:alert(x)'):
|
||||
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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue