【问题标题】:How to escape characters in ofbiz display-entity | XSS in Ofbiz如何在 ofbiz 显示实体中转义字符 | Ofbiz 中的 XSS
【发布时间】:2015-06-08 11:53:54
【问题描述】:

Ofbiz 表单:需要从 display-entity 标签中的描述列中转义字符以避免 XSS 攻击:

<display-entity entity-name="Table" description="${description}" >

我尝试使用bsh,如下:

<display-entity entity-name="Table" description="${bsh: org.apache.commons.lang.StringEscapeUtils.escapeHtml(&quot;${description}&quot;)}">

但我收到此错误:

Error rendering screen [component://my/widget/CommonScreens.xml#GlobalDecorator]: java.lang.IllegalStateException: This object has been flagged as immutable (unchangeable), probably because it came from an Entity Engine cache. Cannot set a value in an immutable entity object. 
(This object has been flagged as immutable (unchangeable), probably because it came from an Entity Engine cache. Cannot set a value in an immutable entity object.)

这里有解决方案来转义描述中的字符吗?

【问题讨论】:

    标签: forms escaping entity xss ofbiz


    【解决方案1】:

    那里没有 XSS 问题,正如 https://issues.apache.org/jira/browse/OFBIZ-6506 所解释的,所以不需要逃跑,它是由 OFBiz 自动完成的

    【讨论】:

    • &lt;display-entity entity-name="Table" description="XSS from DB"&gt; 如果我们提交此脚本:&lt;input type="image" src="javascript:alert('XSS');"&gt; 作为数据库中描述列的值,然后我们继续此表单,出现弹出窗口。这里存在一种从&lt;display-entity 转义描述属性中的字符的方法?
    【解决方案2】:

    我们最近为 Scipio ERP(一个 ofbiz 分支)提交了这个 XSS 漏洞的补丁:

    https://github.com/ilscipio/scipio-erp/commit/cf7e8ef40af06e2903fb50a3f708a455ffd88c2a

    可能值得一试 (www.scipioerp.com)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-14
      • 1970-01-01
      • 2013-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多