Skip to content

Commit 45330ff

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

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
@@ -233,6 +233,11 @@ public function deleteDirectory($path)
233233
$io->getFilteredPath($path)
234234
));
235235
}
236+
if (strpos($pathCmp, chr(0)) !== false
237+
|| preg_match('#(^|[\\\\/])\.\.($|[\\\\/])#', $pathCmp)
238+
) {
239+
throw new Exception('Detected malicious path or filename input.');
240+
}
236241

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

0 commit comments

Comments
 (0)