Skip to content

Commit 4dce22c

Browse files
committed
Merge pull request hestiacp#506 from Flatta/fix-sec-backup
Fix hestiacp#505: Strict backup filename check.
2 parents 9baea19 + dac0b5c commit 4dce22c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web/download/backup/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414

1515
if ((!empty($_SESSION['user'])) && ($_SESSION['user'] != 'admin')) {
16-
if (preg_match("/^".$user."/i", $backup)) {
16+
if (strpos($backup, $user.'.') === 0) {
1717
header('Content-type: application/gzip');
1818
header("Content-Disposition: attachment; filename=\"".$backup."\";" );
1919
header("X-Accel-Redirect: /backup/" . $backup);

0 commit comments

Comments
 (0)