Skip to content

Commit

Permalink
Fix path traversal check when USER-FILES is symbolic link
Browse files Browse the repository at this point in the history
  • Loading branch information
torinfo committed Aug 4, 2024
1 parent 6b324dc commit a2db731
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function appendXML($append)
$template_id = x_clean_input($_POST['template_id'], 'numeric');

// Check whether the folder is correct based on template_id and user name
$folder_path_part = $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $template_id . '-';
$folder_path_part = $xerte_toolkits_site->users_file_area_full . $template_id . '-';
if (strpos($filename, $folder_path_part) !== 0)
{
die("Invalid upload location");
Expand Down

0 comments on commit a2db731

Please sign in to comment.