Private GIT

Skip to content
Snippets Groups Projects
Commit 6e736bb1 authored by Stephane Chapron's avatar Stephane Chapron
Browse files

fix(sec): Fix SQL injection in VirtualMetrics Template

parent 75d3156d
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,7 @@ $SearchTool = null;
$search = '';
if (isset($_POST['searchVM']) && $_POST['searchVM']) {
$search = $_POST['searchVM'];
$SearchTool = " WHERE vmetric_name LIKE '%".$search."%'";
$SearchTool = " WHERE vmetric_name LIKE '%" . $pearDB->escape($search) . "%'";
}
$DBRESULT = $pearDB->query("SELECT COUNT(*) FROM virtual_metrics".$SearchTool);
......@@ -179,7 +179,7 @@ $form->setDefaults(array('o2' => null));
$o2 = $form->getElement('o2');
$o2->setValue(null);
$tpl->assign('limit', $limit);
$tpl->assign('searchVM', $search);
$tpl->assign('searchVM', htmlentities($search));
/*
* Apply a template definition
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment