Skip to content

Commit

Permalink
Fixed upload XSS with wrong extension
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzegit committed Aug 11, 2023
1 parent 7e9d798 commit 7a7e57e
Show file tree
Hide file tree
Showing 3 changed files with 358 additions and 333 deletions.
5 changes: 3 additions & 2 deletions system/controllers/admin/actions/install.php
Expand Up @@ -285,15 +285,16 @@ private function uploadPackage(){

files_clear_directory(cmsConfig::get('upload_path') . $this->installer_upload_path);

$result = $this->cms_uploader->upload($this->upload_name, $this->upload_exts, 0, $this->installer_upload_path);
$result = $this->cms_uploader->setAllowedMime([
'application/zip'
])->upload($this->upload_name, $this->upload_exts, 0, $this->installer_upload_path);

if (!$result['success']){
cmsUser::addSessionMessage($result['error'], 'error');
return false;
}

return $result['name'];

}

}

0 comments on commit 7a7e57e

Please sign in to comment.