Skip to content

Commit ddf1d55

Browse files
committed
.escapeshellarg protection
1 parent b6c152a commit ddf1d55

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

web/edit/user/index.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
}
2525

2626
// List user
27-
exec (VESTA_CMD."v-list-user ".$v_username." json", $output, $return_var);
27+
exec (VESTA_CMD."v-list-user ".escapeshellarg($v_username)." json", $output, $return_var);
2828
check_return_code($return_var,$output);
2929
$data = json_decode(implode('', $output), true);
3030
unset($output);
@@ -89,7 +89,7 @@
8989
$fp = fopen($v_password, "w");
9090
fwrite($fp, $_POST['v_password']."\n");
9191
fclose($fp);
92-
exec (VESTA_CMD."v-change-user-password ".$v_username." ".$v_password, $output, $return_var);
92+
exec (VESTA_CMD."v-change-user-password ".escapeshellarg($v_username)." ".$v_password, $output, $return_var);
9393
check_return_code($return_var,$output);
9494
unset($output);
9595
unlink($v_password);
@@ -99,15 +99,15 @@
9999
// Change package (admin only)
100100
if (($v_package != $_POST['v_package']) && ($_SESSION['user'] == 'admin') && (empty($_SESSION['error_msg']))) {
101101
$v_package = escapeshellarg($_POST['v_package']);
102-
exec (VESTA_CMD."v-change-user-package ".$v_username." ".$v_package, $output, $return_var);
102+
exec (VESTA_CMD."v-change-user-package ".escapeshellarg($v_username)." ".$v_package, $output, $return_var);
103103
check_return_code($return_var,$output);
104104
unset($output);
105105
}
106106

107107
// Change language
108108
if (($v_language != $_POST['v_language']) && (empty($_SESSION['error_msg']))) {
109109
$v_language = escapeshellarg($_POST['v_language']);
110-
exec (VESTA_CMD."v-change-user-language ".$v_username." ".$v_language, $output, $return_var);
110+
exec (VESTA_CMD."v-change-user-language ".escapeshellarg($v_username)." ".$v_language, $output, $return_var);
111111
check_return_code($return_var,$output);
112112
if (empty($_SESSION['error_msg'])) {
113113
if ((empty($_GET['user'])) || ($_GET['user'] == $_SESSION['user'])) $_SESSION['language'] = $_POST['v_language'];
@@ -118,7 +118,7 @@
118118
// Change shell (admin only)
119119
if (($v_shell != $_POST['v_shell']) && ($_SESSION['user'] == 'admin') && (empty($_SESSION['error_msg']))) {
120120
$v_shell = escapeshellarg($_POST['v_shell']);
121-
exec (VESTA_CMD."v-change-user-shell ".$v_username." ".$v_shell, $output, $return_var);
121+
exec (VESTA_CMD."v-change-user-shell ".escapeshellarg($v_username)." ".$v_shell, $output, $return_var);
122122
check_return_code($return_var,$output);
123123
unset($output);
124124
}
@@ -129,7 +129,7 @@
129129
$_SESSION['error_msg'] = __('Please enter valid email address.');
130130
} else {
131131
$v_email = escapeshellarg($_POST['v_email']);
132-
exec (VESTA_CMD."v-change-user-contact ".$v_username." ".$v_email, $output, $return_var);
132+
exec (VESTA_CMD."v-change-user-contact ".escapeshellarg($v_username)." ".$v_email, $output, $return_var);
133133
check_return_code($return_var,$output);
134134
unset($output);
135135
}
@@ -139,7 +139,7 @@
139139
if (($v_fname != $_POST['v_fname']) || ($v_lname != $_POST['v_lname']) && (empty($_SESSION['error_msg']))) {
140140
$v_fname = escapeshellarg($_POST['v_fname']);
141141
$v_lname = escapeshellarg($_POST['v_lname']);
142-
exec (VESTA_CMD."v-change-user-name ".$v_username." ".$v_fname." ".$v_lname, $output, $return_var);
142+
exec (VESTA_CMD."v-change-user-name ".escapeshellarg($v_username)." ".$v_fname." ".$v_lname, $output, $return_var);
143143
check_return_code($return_var,$output);
144144
unset($output);
145145
$v_fname = $_POST['v_fname'];
@@ -157,7 +157,7 @@
157157
$v_ns6 = escapeshellarg($_POST['v_ns6']);
158158
$v_ns7 = escapeshellarg($_POST['v_ns7']);
159159
$v_ns8 = escapeshellarg($_POST['v_ns8']);
160-
$ns_cmd = VESTA_CMD."v-change-user-ns ".$v_username." ".$v_ns1." ".$v_ns2;
160+
$ns_cmd = VESTA_CMD."v-change-user-ns ".escapeshellarg($v_username)." ".$v_ns1." ".$v_ns2;
161161
if (!empty($_POST['v_ns3'])) $ns_cmd = $ns_cmd." ".$v_ns3;
162162
if (!empty($_POST['v_ns4'])) $ns_cmd = $ns_cmd." ".$v_ns4;
163163
if (!empty($_POST['v_ns5'])) $ns_cmd = $ns_cmd." ".$v_ns5;

0 commit comments

Comments
 (0)