Ofbiz:我需要在浏览器中显示来自url参数的值。 为避免XSS攻击,应该转义此值。
该值在PScreens.xml中设置如下:
<screen name="Product">
<section>
<actions>
<set field="productId" from-field="parameters.productId"/>
</actions>
<widgets>
...
</widgets>
并包含在PForms.xml中:
<field name="productId" tooltip="${uiLabelMap.ProductId} [${productId}]"><text /></field>
最初我试图从PForms.xml中转义值:
tooltip="${uiLabelMap.ProductId} [${productId}]"
但我没有找到任何解决方案。
你能建议一个解决方法来逃避PScreens.xml的价值吗?
<set field="productId" from-field="parameters.productId"/>
谢谢。
答案 0 :(得分:0)
这是How to escape characters in ofbiz display-entity | XSS in Ofbiz的副本我认为没有理由要逃避已经自动转义的字符串。有关详细信息,请参阅https://issues.apache.org/jira/browse/OFBIZ-6506
答案 1 :(得分:0)
我现在知道您使用旧的Apache OFBiz版本(前R09.04)。您不能期望通过逐个修补这些旧版本来修复所有安全问题(请参阅http://ofbiz.apache.org/download.html#vulnerabilities)。因此,我建议您调整自定义代码以使用更新版本