fix security hole

missing check for passed parameters allows to read files on the server
This commit is contained in:
Uwe Steinmann 2014-02-26 22:32:19 +01:00
parent d317c744bf
commit 31ffad39a8
2 changed files with 3 additions and 7 deletions

View File

@ -27,7 +27,7 @@ if (!$user->isAdmin()) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
if (isset($_GET["logname"])) $logname=$_GET["logname"];
if (isset($_GET["logname"])) $logname=basename($_GET["logname"]);
else $logname=NULL;
if (isset($_GET["mode"])) $mode=$_GET["mode"];

View File

@ -137,15 +137,11 @@ class SeedDMS_View_LogManagement extends SeedDMS_Bootstrap_Style {
<?php
$this->htmlEndPage();
} elseif(file_exists($this->contentdir.$logname)){
// $this->htmlStartPage(getMLText("backup_tools"));
// $this->contentSubHeading(sanitizeString($logname));
echo $logname."<pre>\n";
readfile($this->contentdir.$logname);
echo "</pre>\n";
// echo "</body>\n</html>\n";
} else {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
} /* }}} */