如何转义inbiz显示实体|中的字符XSS in Ofbiz [英] How to escape characters in ofbiz display-entity | XSS in Ofbiz

查看:303
本文介绍了如何转义inbiz显示实体|中的字符XSS in Ofbiz的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ofbiz表单:需要从显示实体标签中的描述列中转义字符以避免XSS攻击:

  display-entity entity-name =Tabledescription =$ {description}> 

我尝试使用bsh,如下所示:

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

但是我收到这个错误:

 错误渲染屏幕[组件://my/widget/CommonScreens.xml#GlobalDecorator]:java.lang.IllegalStateException:此对象已被标记为不可变(不可更改),可能是因为它来自一个实体引擎缓存。不能在不可变实体对象中设置值。 
(该对象已被标记为不可变(不可更改),可能是因为它来自实体引擎缓存,无法在不可变实体对象中设置值。)
pre>

在这里有一个解决方案来解释描述中的字符?

解决方案

我们最近为Scipio ERP(anbiz fork)的XSS漏洞提供了一个修补程序:



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



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


Ofbiz form: Need to escape characters from description column in a display-entity tag to avoid XSS attacks:

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

I tried to use bsh, as following:

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

But I get this error:

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.)

Exists a solution here to escape chars in description?

解决方案

We recently committed a patch for this XSS vulnerability to Scipio ERP (an ofbiz fork):

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

It may be worth checking it out (www.scipioerp.com).

这篇关于如何转义inbiz显示实体|中的字符XSS in Ofbiz的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆