Merge pull request #1215 from anaggh/master

Fix #1214 Arbitrary file download vulnerability
This commit is contained in:
Diego Najar 2020-06-23 19:59:48 +02:00 committed by GitHub
commit d9adc34081
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,7 +94,10 @@ class pluginBackup extends Plugin {
if (!empty($_GET['file'])) {
$login = new Login();
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 {
Alert::set($L->g('You do not have sufficient permissions'));
Redirect::page('dashboard');