Fix to resolve links before testing allowed path

This commit is contained in:
iliajie
2023-03-18 01:28:21 +02:00
parent b25d128665
commit 6e7eced812

View File

@ -9,7 +9,7 @@ use Cwd 'abs_path';
get_paths();
my $file = &simplify_path($cwd.'/'.$in{'file'});
my $file = &resolve_links(&simplify_path($cwd.'/'.$in{'file'}));
my $error = 1;
for $allowed_path (@allowed_paths) {
if (&is_under_directory($allowed_path, $file)) {