mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Fix path traversal issue detection, the alias folder also needs to end with / for path traversal to happen
This commit is contained in:
parent
acc32c9796
commit
16bb33b884
1 changed files with 6 additions and 5 deletions
|
@ -196,7 +196,7 @@ class App():
|
|||
for line in locationblock[1]:
|
||||
instruction = line[0]
|
||||
if instruction == "alias":
|
||||
yield location
|
||||
yield (location, line)
|
||||
elif isinstance(instruction, list) and instruction and instruction[0] == "location":
|
||||
yield from find_location_with_alias(instruction)
|
||||
else:
|
||||
|
@ -205,8 +205,9 @@ class App():
|
|||
def find_path_traversal_issue(nginxconf):
|
||||
|
||||
for block in nginxconf:
|
||||
for location in find_location_with_alias(block):
|
||||
if not location.endswith("/"):
|
||||
for location, alias in find_location_with_alias(block):
|
||||
alias_path = alias[-1]
|
||||
if not location.endswith("/") and alias_path.endswith("/"):
|
||||
yield location
|
||||
|
||||
for location in find_path_traversal_issue(nginxconf):
|
||||
|
|
Loading…
Reference in a new issue