mirror of https://gitlab.com/bashrc2/epicyon
Allow well-known
parent
0aec071dea
commit
428900c9a0
6
utils.py
6
utils.py
|
@ -5510,6 +5510,12 @@ 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()
|
||||||
|
|
||||||
|
# allow /.well-known/...
|
||||||
|
if '/.' in path_lower and \
|
||||||
|
path_lower.startswith('/.well-known/'):
|
||||||
|
return False
|
||||||
|
|
||||||
bad_strings = ('..', '/.', '%2e%2e', '%252e%252e')
|
bad_strings = ('..', '/.', '%2e%2e', '%252e%252e')
|
||||||
if string_contains(path_lower, bad_strings):
|
if string_contains(path_lower, bad_strings):
|
||||||
print('WARN: bad path ' + path)
|
print('WARN: bad path ' + path)
|
||||||
|
|
Loading…
Reference in New Issue