Skip to content
Snippets Groups Projects
Commit b6ebb101 authored by Prasad's avatar Prasad
Browse files

Ensure file-attachment is restricted to storage dir.

parent 8d4cc0ed
No related branches found
No related tags found
No related merge requests found
......@@ -221,6 +221,11 @@ class Emails_MassSaveAjax_View extends Vtiger_Footer_View {
$newFilePath = $upload_file_path . $current_id . "_" . $encryptFileName;
Vtiger_Utils::checkFileAccess($oldFilePath);
//restrict attachment only from storage directory
if (strpos($oldFilePath, "storage/") !== 0) {
throw new Exception("Attachment access denied");
}
copy($oldFilePath, $newFilePath);
$sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(?, ?, ?, ?, ?, ?, ?)";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment