1
我在我的JSP定义为输入标签:如何从JSP中删除这个XSS?
<input type="text" name="transCurrency" maxlength="10" size="10" value="<%=beanUseVec.getValue("transCurrency")%>" />
相应的功能getValue()
在beanUseVec.java
定义为:
public String getValue(String vectK)
{
if(uEnVec != null && uEnVec.containsKey(vectK))
return (String)uEnVec.get(vectK);
else
return "";
}
当我做了veracode扫描我的文件,我发现XSS错误如下图所示:
<input type="text" name="transCurrency" maxlength="10" size="10" value="<%=beanUseVec.getValue("transCurrency")%>" />
它指出<%=beanUseVec.getValue("transCurrency")%>
是XSS风险。通常,对于JSP中的其他XSS风险,我使用jstl c:out
标记,我认为这个标记在这里不能使用,因为getValue()
不是POJO函数,它只是一个返回字符串的函数,而c:out
需要调用POJO函数的变量。
有人可以建议任何其他方式摆脱这个XSS的问题?
谢谢你让我检查。 –
非常感谢,它像一个魅力.Accepted和投票。 –
我很高兴它帮助:) – vjy