mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
f7546896f6
commit
8ca03c3e20
5
utils.py
5
utils.py
|
@ -5508,9 +5508,8 @@ def check_bad_path(path: str):
|
||||||
"""for http GET or POST check that the path looks valid
|
"""for http GET or POST check that the path looks valid
|
||||||
"""
|
"""
|
||||||
path_lower = path.lower()
|
path_lower = path.lower()
|
||||||
if '..' in path_lower or \
|
bad_strings = ('..', '/.', '%2e%2e', '%252e%252e')
|
||||||
'%2e%2e' in path_lower or \
|
if string_contains(path_lower, bad_strings):
|
||||||
'%252e%252e' in path_lower:
|
|
||||||
print('WARN: bad path ' + path)
|
print('WARN: bad path ' + path)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue