Skip to content

Commit

Permalink
#3410 - Directory traversal (any file download)
Browse files Browse the repository at this point in the history
  • Loading branch information
abrookbanks committed Oct 30, 2023
1 parent 100cbe8 commit 5c9f630
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion admin/sources/filemanager.index.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@


if(isset($_GET['download_file']) && !empty($_GET['download_file'])) {
$file = CC_ROOT_DIR.'/'.base64_decode($_GET['download_file']);
$file = base64_decode($_GET['download_file']);
$file = str_replace(array('..'.DIRECTORY_SEPARATOR,'.'.DIRECTORY_SEPARATOR),'',$file);
$file = ltrim($file, DIRECTORY_SEPARATOR);
$file = CC_ROOT_DIR.'/'.$file;
if(file_exists($file)) { // It really should exist
deliverFile($file);
}
Expand Down

0 comments on commit 5c9f630

Please sign in to comment.