Skip to content

Commit 512283e

Browse files
committed
Potential remote code execution vulnerability fix.
Can be exploitable, when we have X-Forwarded-For->X-Real-IP transformation.
1 parent 9c59a69 commit 512283e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web/api/index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
$v_user = escapeshellarg($_POST['user']);
1616
$v_password = escapeshellarg($_POST['password']);
17-
exec(VESTA_CMD ."v-check-user-password ".$v_user." ".$v_password." '".$_SERVER["REMOTE_ADDR"]."'", $output, $auth_code);
17+
$v_ip_addr = escapeshellarg($_SERVER["REMOTE_ADDR"]);
18+
exec(VESTA_CMD ."v-check-user-password ".$v_user." ".$v_password." '".$v_ip_addr."'", $output, $auth_code);
1819
} else {
1920
$key = '/usr/local/vesta/data/keys/' . basename($_POST['hash']);
2021
if (file_exists($key) && is_file($key)) {

0 commit comments

Comments
 (0)