As you can see, unlink() is being used to with a usercontrolled parameter dl, one can use path manipulation techniques like /../ and refer to files and get them removed by unlink(). this isn't as critical as the install.php file gets removed after install, it is when it isn't.
Thanks,
In Piwigo/install.php:
120: $filename = PHPWG_ROOT_PATH . $conf['data_location'] . 'pwg_' . $_GET['dl'];
127: unlink($filename);
As you can see, unlink() is being used to with a usercontrolled parameter dl, one can use path manipulation techniques like /../ and refer to files and get them removed by unlink(). this isn't as critical as the install.php file gets removed after install, it is when it isn't.
Thanks,
<!-- github-sync-id:196307930 -->
Hi @Shinkurt
Did you also see:
```
116: check_input_parameter('dl', $_GET, false, '/^[a-f0-9]{32}$/');
```
It should prevent any "../../" attempt :-)
<!-- github-comment-id:267927776 -->
@plegall yeah, that is one thing I'd like to mention. that parameter, although checks the input, it doesn't exit() if it occurs. check_input_parameter(), instead of closing with a die() or exit() if they are encountered, it instead calls fatal_error() which basically just prints out error. but adding a die or exit in that function will solve it.
Thanks,
@plegall yeah, that is one thing I'd like to mention. that parameter, although checks the input, it doesn't exit() if it occurs. check_input_parameter(), instead of closing with a die() or exit() if they are encountered, it instead calls fatal_error() which basically just prints out error. but adding a die or exit in that function will solve it.
Thanks,
<!-- github-comment-id:267973710 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
In Piwigo/install.php:
120: $filename = PHPWG_ROOT_PATH . $conf['data_location'] . 'pwg_' . $_GET['dl'];
127: unlink($filename);
As you can see, unlink() is being used to with a usercontrolled parameter dl, one can use path manipulation techniques like /../ and refer to files and get them removed by unlink(). this isn't as critical as the install.php file gets removed after install, it is when it isn't.
Thanks,
Hi @Shinkurt
Did you also see:
It should prevent any "../../" attempt :-)
@plegall yeah, that is one thing I'd like to mention. that parameter, although checks the input, it doesn't exit() if it occurs. check_input_parameter(), instead of closing with a die() or exit() if they are encountered, it instead calls fatal_error() which basically just prints out error. but adding a die or exit in that function will solve it.
Thanks,
here is the end of fatal_error function:
it seems good enough for me :-)