Skip to content

Commit 75dd04a

Browse files
authored
Escape user variable in /keys/ (hestiacp#1667)
Remove potenial leak 2fa status
1 parent 1a65555 commit 75dd04a

File tree

4 files changed

+7
-28
lines changed

4 files changed

+7
-28
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ All notable changes to this project will be documented in this file.
4040
- Improved IDN domain handling to resolve issues with Let's Encrypt SSL and mail domain services.
4141
- Added private folder to openbasedir permission for all main templates.
4242
- Disabled changing backup folder via Web UI because it used symbolic link instead of mount causing issues with restore mail / user files.
43-
- Fix xss vulnerability in v-add-sys-ip (thanks @numanturle)
43+
- Fixed xss vulnerability in v-add-sys-ip (thanks **@numanturle**)
44+
- Fixed remote execution possibility when deleting ssh key (thanks **@numanturle**)
4445

4546
## [1.3.3] - Service Release
4647
### Bugfixes

web/delete/key/index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
77

88
if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
9-
$user=$_GET['user'];;
9+
$user=$_GET['user'];
1010
}
1111

1212
// Check token
@@ -17,8 +17,9 @@
1717

1818
if (!empty($_GET['key'])) {
1919
$v_key = escapeshellarg(trim($_GET['key']));
20+
$v_user = escapeshellarg(trim($v_user));
2021
$v_key = str_replace('/','\\/', $v_key);
21-
exec (HESTIA_CMD."v-delete-user-ssh-key ".$user." ".$v_key);
22+
exec (HESTIA_CMD."v-delete-user-ssh-key ".$v_user." ".$v_key);
2223
check_return_code($return_var,$output);
2324
}
2425

web/inc/2fa/active.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

web/login/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ function authenticate_user($user, $password, $twofa = ''){
9797
$data = json_decode(implode('', $output), true);
9898
unset($output);
9999
if ($data[$user]['TWOFA'] != '') {
100-
if(empty($_POST['twofa'])){
100+
if(empty($twofa)){
101101
return false;
102102
}else{
103-
$v_twofa = $_POST['twofa'];
103+
$v_twofa = escapeshellarg($twofa);
104104
exec(HESTIA_CMD ."v-check-user-2fa ".$v_user." ".$v_twofa, $output, $return_var);
105105
unset($output);
106106
if ( $return_var > 0 ) {

0 commit comments

Comments
 (0)