ExpressionEngine · Report #250587
Potential code injection in fun delete_directory
Validstatus
mediumseverity
2upvotes
7 Sept 2017disclosed
How it was found
Under /system/ee/legacy/libraries/Functions.php, function delete_directory contains calls to exec 3 times using different, potentially "unsanitized" paramateres. As the PHP manual suggest, escapeshellarg should be used to sanitize individual arguments [1].
On an implementation in which the attacker controls the file name, arbitrary code execution is achieved. Better to fix it.