End processing when file is not found

We have to end the processing when a file is not found or otherwise the method is proceeding and even sending invalid file paths to the sendfile methods.

Due to nginx preventing directory traversals this is luckily not immediately exploitable. We should for hardening purposes however quit the script execution just as we do for 403 cases and others as well.
This commit is contained in:
Lukas Reschke 2015-05-22 11:53:02 +02:00
parent 94077caea9
commit 8ce3d6ea57
1 changed files with 1 additions and 0 deletions

View File

@ -138,6 +138,7 @@ class OC_Files {
header("HTTP/1.0 404 Not Found"); header("HTTP/1.0 404 Not Found");
$tmpl = new OC_Template('', '404', 'guest'); $tmpl = new OC_Template('', '404', 'guest');
$tmpl->printPage(); $tmpl->printPage();
exit();
} else { } else {
header("HTTP/1.0 403 Forbidden"); header("HTTP/1.0 403 Forbidden");
die('403 Forbidden'); die('403 Forbidden');