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

Commit

Permalink
fix(acl access groups): Fix XSS vulnerability (#6710)
Browse files Browse the repository at this point in the history
FIX: MON-2879
Fix XSS on Menu access list link
Secure all name against XSS vulnerability
  • Loading branch information
callapa authored Oct 3, 2018
1 parent 73ee01c commit 669a620
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions www/include/options/accessLists/groupsACL/formGroupConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
/*
* Set base value
*/
$group = array_map("myDecode", $DBRESULT->fetchRow());
$group = array_map("CentreonUtils::escapeAll", $DBRESULT->fetchRow());

/*
* Set Contact Childs
Expand Down Expand Up @@ -128,7 +128,10 @@
. "ORDER BY contact_name";
$DBRESULT = $pearDB->query($query);
while ($contact = $DBRESULT->fetchRow()) {
$contacts[$contact["contact_id"]] = $contact["contact_name"];
$contacts[$contact["contact_id"]] = CentreonUtils::escapeAll(
$contact["contact_name"],
CentreonUtils::ESCAPE_ALL
);
}
unset($contact);
$DBRESULT->closeCursor();
Expand All @@ -140,7 +143,10 @@
$menus = array();
$DBRESULT = $pearDB->query("SELECT acl_topo_id, acl_topo_name FROM acl_topology ORDER BY acl_topo_name");
while ($topo = $DBRESULT->fetchRow()) {
$menus[$topo["acl_topo_id"]] = $topo["acl_topo_name"];
$menus[$topo["acl_topo_id"]] = CentreonUtils::escapeAll(
$topo["acl_topo_name"],
CentreonUtils::ESCAPE_ALL
);
}
unset($topo);
$DBRESULT->closeCursor();
Expand All @@ -149,7 +155,10 @@
$action = array();
$DBRESULT = $pearDB->query("SELECT acl_action_id, acl_action_name FROM acl_actions ORDER BY acl_action_name");
while ($data = $DBRESULT->fetchRow()) {
$action[$data["acl_action_id"]] = $data["acl_action_name"];
$action[$data["acl_action_id"]] = CentreonUtils::escapeAll(
$data["acl_action_name"],
CentreonUtils::ESCAPE_ALL
);
}
unset($data);
$DBRESULT->closeCursor();
Expand All @@ -162,7 +171,10 @@
. 'ORDER BY acl_res_name';
$DBRESULT = $pearDB->query($query);
while ($res = $DBRESULT->fetchRow()) {
$resources[$res["acl_res_id"]] = $res["acl_res_name"];
$resources[$res["acl_res_id"]] = CentreonUtils::escapeAll(
$res["acl_res_name"],
CentreonUtils::ESCAPE_ALL
);
}
unset($res);
$DBRESULT->closeCursor();
Expand Down

0 comments on commit 669a620

Please sign in to comment.