Skip to content

Commit 0ef51ec

Browse files
Merge pull request from GHSA-5vpv-xmcj-9q85
Co-authored-by: Fabrizio Balliano <[email protected]>
1 parent 8dd5439 commit 0ef51ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,11 @@ public function deleteDirectory($path)
231231
$io->getFilteredPath($path)
232232
));
233233
}
234+
if (strpos($pathCmp, chr(0)) !== false
235+
|| preg_match('#(^|[\\\\/])\.\.($|[\\\\/])#', $pathCmp)
236+
) {
237+
throw new Exception('Detected malicious path or filename input.');
238+
}
234239

235240
if (Mage::helper('core/file_storage_database')->checkDbUsage()) {
236241
Mage::getModel('core/file_storage_directory_database')->deleteDirectory($path);

0 commit comments

Comments
 (0)