From 54c13797a3dd2bd30f4928c5a2c65afa6cab860a Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Fri, 20 Nov 2026 14:02:34 +0000 Subject: [PATCH] fix from @cboltz - stop domain admin from enumerating all admin/superadmin accounts via list.php?table=adminpassword --- model/AdminpasswordHandler.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/model/AdminpasswordHandler.php b/model/AdminpasswordHandler.php index 73c0ce20..b50691b7 100644 --- a/model/AdminpasswordHandler.php +++ b/model/AdminpasswordHandler.php @@ -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 */