mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°3412 - Command Injection vulnerability in the Setup Wizard - handle empty path
This commit is contained in:
@@ -554,19 +554,21 @@ class SetupUtils
|
||||
return new CheckResult(CheckResult::ERROR, "The PHP exec() function has been disabled on this server");
|
||||
}
|
||||
|
||||
clearstatcache();
|
||||
if (!is_file($sGraphvizPath) || ! is_executable($sGraphvizPath)){
|
||||
//N°3412 avoid shell injection
|
||||
return new CheckResult(CheckResult::ERROR, "$sGraphvizPath could not be executed: Please make sure it is installed and in the path");
|
||||
}
|
||||
|
||||
$sGraphvizPath = escapeshellcmd($sGraphvizPath);
|
||||
|
||||
// availability of dot / dot.exe
|
||||
if (empty($sGraphvizPath))
|
||||
{
|
||||
$sGraphvizPath = 'dot';
|
||||
} else {
|
||||
clearstatcache();
|
||||
if (!is_file($sGraphvizPath) || !is_executable($sGraphvizPath)) {
|
||||
//N°3412 avoid shell injection
|
||||
return new CheckResult(CheckResult::ERROR,
|
||||
"$sGraphvizPath could not be executed: Please make sure it is installed and in the path");
|
||||
}
|
||||
|
||||
$sGraphvizPath = escapeshellcmd($sGraphvizPath);
|
||||
}
|
||||
|
||||
$sCommand = "\"$sGraphvizPath\" -V 2>&1";
|
||||
|
||||
$aOutput = array();
|
||||
|
||||
Reference in New Issue
Block a user