1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/14789] Add link hashes and form tokens to all acp links/buttons

This will further harden the ACP security by adding link hashes to links and
form tokens to forms that did not have these yet and result in modified
settings or write action on the filesystem or database. These few links and
forms were still relying on the global ACP protection, mainly due to them
not posing further risks of compromising data. After this change these will
now also be properly protected against tampering.

PHPBB3-14789
This commit is contained in:
Marc Alexander
2016-09-18 01:14:23 +02:00
parent 27e33f39f7
commit 585a3ed863
8 changed files with 111 additions and 17 deletions

View File

@@ -366,6 +366,11 @@ class acp_permission_roles
case 'move_up':
case 'move_down':
if (!check_link_hash($request->variable('hash', ''), 'acp_permission_roles'))
{
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT role_order
FROM ' . ACL_ROLES_TABLE . "
WHERE role_id = $role_id";
@@ -440,8 +445,8 @@ class acp_permission_roles
'U_EDIT' => $this->u_action . '&action=edit&role_id=' . $row['role_id'],
'U_REMOVE' => $this->u_action . '&action=remove&role_id=' . $row['role_id'],
'U_MOVE_UP' => $this->u_action . '&action=move_up&role_id=' . $row['role_id'],
'U_MOVE_DOWN' => $this->u_action . '&action=move_down&role_id=' . $row['role_id'],
'U_MOVE_UP' => $this->u_action . '&action=move_up&role_id=' . $row['role_id'] . '&hash=' . generate_link_hash('acp_permission_roles'),
'U_MOVE_DOWN' => $this->u_action . '&action=move_down&role_id=' . $row['role_id'] . '&hash=' . generate_link_hash('acp_permission_roles'),
'U_DISPLAY_ITEMS' => ($row['role_id'] == $display_item) ? '' : $this->u_action . '&display_item=' . $row['role_id'] . '#assigned_to')
);