Skip to content

Commit

Permalink
fixes #179, preventing path traversal
Browse files Browse the repository at this point in the history
  • Loading branch information
azett committed Dec 25, 2022
1 parent 3cc223d commit 5d5c7f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fp-plugins/mediamanager/panels/panel.mediamanager.file.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ function doItemActions($folder, $mmbaseurl) {
/* delete file */
if (isset($_GET ['deletefile'])) {
list ($type, $name) = explode("-", $_GET ['deletefile'], 2);
// prevent path traversal: remove ".." and "/" resp. "\"
$name = preg_replace('(\.\.|\/|\\\\)', '', $name);
switch ($type) {
case 'attachs':
$type = ABS_PATH . ATTACHS_DIR;
Expand Down

0 comments on commit 5d5c7f6

Please sign in to comment.