Fix #1246 Arbitrary zip/directory deletion vulnerability in backup plugin
This commit is contained in:
parent
9a82bd4f32
commit
96c21ed2ea
1 changed files with 8 additions and 0 deletions
|
@ -290,6 +290,14 @@ class pluginBackup extends Plugin {
|
|||
{
|
||||
global $L;
|
||||
|
||||
// Prevent arbitrary deletion. Check if directory/zip backup exists
|
||||
if (! in_array(
|
||||
$this->zip ? "$filename.zip" : $filename,
|
||||
array_map('basename', glob($this->workspace().'*')))
|
||||
) {
|
||||
return $this->response(400, sprintf($L->get("Invalid Backup '%s'"), $filename));
|
||||
}
|
||||
|
||||
if ($this->zip) {
|
||||
// Zip format
|
||||
$tmp = $this->workspace().$filename.'.zip';
|
||||
|
|
Loading…
Add table
Reference in a new issue