stop a domain admin from being able to enumerate all admin/superadmin usernames via list.php?table=adminpassword (thanks @cboltz & @mirko)

This commit is contained in:
David Goodwin committed 2026-11-18 09:57:34 +00:00
1 parent e9dce61e5e
commit 17930537de
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
*/