Fix false positive warning for path traversal issue

This commit is contained in:
Alexandre Aubin 2021-10-10 16:38:01 +02:00
parent 97f2441cf4
commit e07d9c5133

View file

@ -902,6 +902,11 @@ class Configurations(TestSuite):
if location.startswith("^") and location.endswith("$"): if location.startswith("^") and location.endswith("$"):
continue continue
alias_path = alias[-1] alias_path = alias[-1]
# Ugly hack to ignore cases where aliasing to a specific file (e.g. favicon.ico or foobar.html)
if "." in alias_path[-5]:
continue
# 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)
# - alias /var/www/foo/ (*with* a / after foo) # - alias /var/www/foo/ (*with* a / after foo)