Fix an edge case of path traversal detection

This commit is contained in:
Alexandre Aubin 2020-10-08 16:06:19 +02:00
parent 79c52b28c7
commit 01adf07c5e

View file

@ -526,6 +526,9 @@ class App(TestSuite):
for block in nginxconf: for block in nginxconf:
for location, alias in find_location_with_alias(block): for location, alias in find_location_with_alias(block):
# Ignore locations which are regexes..?
if location.startswith("^") and location.endswith("$"):
continue
alias_path = alias[-1] alias_path = alias[-1]
# For path traversal issues to occur, both of those are needed : # For path traversal issues to occur, both of those are needed :
# - location /foo { (*without* a / after foo) # - location /foo { (*without* a / after foo)