fix from @cboltz - stop domain admin from enumerating all admin/superadmin accounts via list.php?table=adminpassword

This commit is contained in:
David Goodwin committed 2026-11-20 14:02:34 +00:00
1 parent 7a1eb67db2
commit 54c13797a3
1 file changed
+12
+12
View File
@@ -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
*/