[ 
https://issues.apache.org/jira/browse/OFBIZ-6506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14623383#comment-14623383
 ] 

Jacques Le Roux commented on OFBIZ-6506:
----------------------------------------

I don't see what you are chasing. If I put
{code}
?productId=<script>alert('alert')</script>
{code}
after an URL, and use
{code}
<field name="productId" tooltip="${uiLabelMap.ProductId} [${productId}]"><text 
size="20" maxlength="20"/></field>
{code}
in a form, after passing the partyId value from a screen with
{code}
<set field="productId" from-field="parameters.productId"/>
{code}

This is what I get on screen !Tooltip no XSS issue.png!
And this is what I see in the HTML source
{code}
<input type="text" name="productId"  
value="&lt;script&gt;alert&#x28;&#x27;alert&#x27;&#x29;&lt;&#x2f;script&gt;" 
size="20" maxlength="20" id="addSmsContactPerson_productId" /><script 
language="JavaScript" type="text/javascript">ajaxAutoCompleter('', false, 2, 
300);</script>
<span class="tooltip">Product Id 
&#x5b;&lt;script&gt;alert&#x28;&#x27;alert&#x27;&#x29;&lt;&#x2f;script&gt;&#x5d;</span>
{code}

Of course, same when using your example, which is in no way a mean to show an 
XSS issue. A JavaScript must be actionable, I think I was pretty clear with the 
examples I gave above.
{code}
<input type="text" name="productId"   value="&lt;font 
color&#x3d;red&gt;XSS&lt;&#x2f;font&gt;"  size="20" maxlength="20" 
id="formName_productId"/><script language="JavaScript" 
type="text/javascript">ajaxAutoCompleter('', false, 2, 300);</script>
<span class="tooltip">Product Id &#x5b;&lt;font 
color&#x3d;red&gt;XSS&lt;&#x2f;font&gt;&#x5d;</span>
{code}

So it's now clear to me that this does not show an XSS vulnerability and I 
close this issue as invalid.

A last question though, which version are you using? I used the trunk HEAD but 
normally none of the supported versions have XSS vulnerabilities. All known so 
far have been fixed months ago, see the "Security Vulnerabilities" section at 
the bottom of http://ofbiz.apache.org/download.html. Last being fixed for 
almost a year.

> XSS vulnerability in OFBiz forms and screens especially in display-entity 
> component
> -----------------------------------------------------------------------------------
>
>                 Key: OFBIZ-6506
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6506
>             Project: OFBiz
>          Issue Type: Bug
>          Components: ALL COMPONENTS
>            Reporter: Lilian Iatco
>            Assignee: Jacques Le Roux
>              Labels: display, entity, form, ofbiz, screen, vulnerability, xss
>         Attachments: Tooltip no XSS issue.png
>
>
> In Ofbiz form need to escape characters from description column in a 
> display-entity tag to avoid XSS attacks.
> {code}<display-entity entity-name="Table" description="${description}" >{code}
> I tried to use bsh, as following:
> {code}<display-entity entity-name="Table" description="${bsh: 
> org.apache.commons.lang.StringEscapeUtils.escapeHtml(&quot;${description}&quot;)}">{code}
> But I get this error:
> {code}
> 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.)
> {code}
> PS:
> Also you can see here a similar issue:
> http://stackoverflow.com/questions/30097370/how-to-escape-characters-in-ofbiz-widget



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to