#565 Fixed security issues (XSS)

SVN:trunk[2282]
This commit is contained in:
Romain Quetiez
2012-10-17 15:38:09 +00:00
parent 0f9280399b
commit ce77c65e6e
3 changed files with 5 additions and 3 deletions

View File

@@ -1371,7 +1371,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
if (is_null($aAllowedValues))
{
// Any value is possible, display an input box
$sHtml .= "<label>".MetaModel::GetFilterLabel($sClassName, $sFilterCode).":</label>&nbsp;<input class=\"textSearch\" name=\"$sFilterCode\" value=\"$sFilterValue\"/>\n";
$sHtml .= "<label>".MetaModel::GetFilterLabel($sClassName, $sFilterCode).":</label>&nbsp;<input class=\"textSearch\" name=\"$sFilterCode\" value=\"".htmlentities($sFilterValue, ENT_QUOTES, 'utf-8')."\"/>\n";
}
else
{

View File

@@ -102,7 +102,8 @@ try
}
catch (Exception $e)
{
echo $e->GetMessage();
// note: transform to cope with XSS attacks
echo htmlentities($e->GetMessage(), ENT_QUOTES, 'utf-8');
IssueLog::Error($e->getMessage());
}
?>

View File

@@ -875,7 +875,8 @@ try
}
catch (Exception $e)
{
echo $e->GetMessage();
// note: transform to cope with XSS attacks
echo htmlentities($e->GetMessage(), ENT_QUOTES, 'utf-8');
echo "<p>Debug trace: <pre>".print_r($e->getTrace(), true)."</pre></p>\n";
IssueLog::Error($e->getMessage());
}