Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(secu): sanitize ACL group delete action (#10795)
Browse files Browse the repository at this point in the history
  • Loading branch information
sc979 authored Feb 24, 2022
1 parent fd4fbea commit c56a3c5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions www/include/options/accessLists/groupsACL/DB-Func.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,16 @@ function deleteGroupInDB($groups = array())
global $pearDB, $centreon;

foreach ($groups as $key => $value) {
$query = "SELECT acl_group_name FROM `acl_groups` WHERE acl_group_id = '" . (int)$key . "' LIMIT 1";
$dbResult = $pearDB->query($query);
$dbResult = $pearDB->prepare(
"SELECT acl_group_name FROM `acl_groups` WHERE acl_group_id = :aclGroupId LIMIT 1"
);
$dbResult->bindValue('aclGroupId', $key, PDO::PARAM_INT);
$dbResult->execute();
$row = $dbResult->fetch();
$pearDB->query("DELETE FROM acl_groups WHERE acl_group_id = '" . $key . "'");
$centreon->CentreonLogAction->insertLog("access group", $key, $row['acl_group_name'], "d");
$dbResult = $pearDB->prepare("DELETE FROM acl_groups WHERE acl_group_id = :aclGroupId");
$dbResult->bindValue('aclGroupId', $key, PDO::PARAM_INT);
$dbResult->execute();
$centreon->CentreonLogAction->insertLog("access group", (int) $key, $row['acl_group_name'], "d");
}
}

Expand Down

0 comments on commit c56a3c5

Please sign in to comment.