Enumeration params = req.getParameterNames();
String sPrefix = "prefix_";
while (params.hasMoreElements())
{
String paramName = (String) params.nextElement();
if (paramName.startsWith(sPrefix))
{
String value = (Tool.getValue(req.getParameter(paramName)));
try {
session.setAttribute(ESAPI.validator().getValidInput("SafeCheckString",paramName,"SafeCheckString",1024,true), ESAPI.validator().getValidInput("SafeCheckString",value,"SafeCheckString",1024,true));//flaw
}
catch (ValidationException e)
{
ServiceHandler.writeException("Validation Exception occured while validating Input",e);
} catch (IntrusionException e)
{
ServiceHandler.writeException("Intrusion Exception occured while validating Input",e);
}
}
}
我在代码中遇到信任边界违规(session.setAttribute(....),同时触发veracode。
我该如何解决这个问题。