Fix #1214 Arbitrary file download vulnerability
This commit is contained in:
parent
e3abd64fe4
commit
7689aa5fb4
1 changed files with 4 additions and 1 deletions
|
@ -94,7 +94,10 @@ class pluginBackup extends Plugin {
|
||||||
if (!empty($_GET['file'])) {
|
if (!empty($_GET['file'])) {
|
||||||
$login = new Login();
|
$login = new Login();
|
||||||
if ($login->role() === 'admin') {
|
if ($login->role() === 'admin') {
|
||||||
downloadRestrictedFile(PATH_WORKSPACES.'backup/'.$_GET['file']);
|
$existingBackups = array_map('basename', glob(PATH_WORKSPACES.'backup/*.zip'));
|
||||||
|
if (in_array($_GET['file'], $existingBackups)) {
|
||||||
|
downloadRestrictedFile(PATH_WORKSPACES.'backup/'.$_GET['file']);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Alert::set($L->g('You do not have sufficient permissions'));
|
Alert::set($L->g('You do not have sufficient permissions'));
|
||||||
Redirect::page('dashboard');
|
Redirect::page('dashboard');
|
||||||
|
|
Loading…
Reference in a new issue