Revert "[SECURITY] Fix OS command injection."

This commit is contained in:
Serghey Rodin 2015-12-11 21:14:49 +02:00
commit 39e9b6397b
115 changed files with 1980 additions and 1340 deletions

View file

@ -9,7 +9,7 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit;
exit();
}
$domain = $_POST['domain'];
@ -58,18 +58,21 @@ if ($_SESSION['user'] == 'admin') {
if (empty($account)) {
foreach ($domain as $value) {
// Mail
v_exec($cmd, [$user, $value], false);
$value = escapeshellarg($value);
exec (VESTA_CMD.$cmd." ".$user." ".$value, $output, $return_var);
$restart = 'yes';
}
} else {
foreach ($account as $value) {
// Mail Account
v_exec($cmd, [$user, $domain, $value], false);
$value = escapeshellarg($value);
$dom = escapeshellarg($domain);
exec (VESTA_CMD.$cmd." ".$user." ".$dom." ".$value, $output, $return_var);
$restart = 'yes';
}
}
if (empty($account)) {
if (empty($account)) {
header("Location: /list/mail/");
exit;
} else {