Skip to content

Commit fb306e9

Browse files
committed
daemon/script: Make absolutely sure to prevent traversal attacks
1 parent fae1346 commit fb306e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

application/controllers/DaemonController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function scriptAction(): void
6060
->getBaseDir() . '/public/js';
6161

6262
$filePath = realpath($root . DIRECTORY_SEPARATOR . 'notifications-' . $fileName . $extension);
63-
if ($filePath === false) {
63+
if ($filePath === false || substr($filePath, 0, strlen($root)) !== $root) {
6464
if ($fileName === 'undefined') {
6565
$this->httpNotFound(t("No file name submitted"));
6666
}

0 commit comments

Comments
 (0)