mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-11-20 23:43:26 +03:00
fix from @cboltz - stop domain admin from enumerating all admin/superadmin accounts via list.php?table=adminpassword
This commit is contained in:
1 file changed
+12
@@ -37,6 +37,7 @@ class AdminpasswordHandler extends PFAHandler
|
||||
/*dont_write_to_db*/ 1,
|
||||
/*select*/ 'password as password2'
|
||||
),
|
||||
'_can_delete' => self::pacol(0, 0, 1, 'vnum', '', '', '', [], 0, 1, '0 as _can_delete'),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -84,6 +85,17 @@ class AdminpasswordHandler extends PFAHandler
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* This class is meant to let a logged admin change their own password.
|
||||
* It doesn't make sense to use this class in list view.
|
||||
* Limit build_select_query() to the logged-in admin to prevent disclosing other admin usernames
|
||||
*/
|
||||
protected function build_select_query($condition, array $searchmode): array
|
||||
{
|
||||
$condition = array('username' => $this->admin_username);
|
||||
return parent::build_select_query($condition, $searchmode);
|
||||
}
|
||||
|
||||
/**
|
||||
* check if old password is correct
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user