Skip to content

Commit d31571c

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

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
@@ -230,6 +230,11 @@ public function deleteDirectory($path)
230230
$io->getFilteredPath($path)
231231
));
232232
}
233+
if (strpos($pathCmp, chr(0)) !== false
234+
|| preg_match('#(^|[\\\\/])\.\.($|[\\\\/])#', $pathCmp)
235+
) {
236+
throw new Exception('Detected malicious path or filename input.');
237+
}
233238

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

0 commit comments

Comments
 (0)