regexp fixes and validation (#829)
This commit is contained in:
parent
e834b33d42
commit
fe954632c0
@ -210,6 +210,8 @@ def get_path_for_vm(vm, service_name):
|
|||||||
if len(untrusted_path) == 0:
|
if len(untrusted_path) == 0:
|
||||||
return None
|
return None
|
||||||
if path_re.match(untrusted_path):
|
if path_re.match(untrusted_path):
|
||||||
|
assert '../' not in untrusted_path
|
||||||
|
assert '\0' not in untrusted_path
|
||||||
return untrusted_path.strip()
|
return untrusted_path.strip()
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user