<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Cross site scripting - XSS</title><link>https://answers.axonivy.com/questions/4054/cross-site-scripting-xss</link><description>&lt;p&gt;Dear Ivy team&lt;/p&gt;
&lt;p&gt;Just recently we had a security audit which reported that our app is vulnerable to XSS attacks. The issue is that the Primeface input fields (whatever control) seem not to be escaped. By default it should be escape="true" but it seems it's escape="false" which would be really bad (for all Ivy based applications).&lt;/p&gt;
&lt;p&gt;Any idea why this is the case ? May be an outdated jsf lib ?&lt;/p&gt;
&lt;p&gt;Best regards
John&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/4054/cross-site-scripting-xss" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 09 Oct 2019 04:17:26 -0400</lastBuildDate><item><title>Comment by Reguel Wermelinger on SupportIvyTeam's answer</title><link>https://answers.axonivy.com/questions/4054/cross-site-scripting-xss#4082</link><description>&lt;p&gt;I'd say that primefaces components are by default save and tested to not be vulnerable to XSS attacks. However, once the user prints data of the Html Dialog (collected via inputText elements and similar) directly on the front-end, then the developer has to ensure that is done in safe way. Especially plain El-Expressions that access data outside of a JSF widget build for it are vulnerable for the light-hearted introduced of new security issues. 
To make implementations save: always use 'value' attributes of primefaces components built to output users input.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Wed, 09 Oct 2019 04:17:26 -0400</pubDate><guid>https://answers.axonivy.com/questions/4054/cross-site-scripting-xss#4082</guid></item><item><title>Answer by SupportIvyTeam</title><link>https://answers.axonivy.com/questions/4054/cross-site-scripting-xss/4074</link><description>&lt;p&gt;Hi John&lt;/p&gt;
&lt;p&gt;Generally every jsf and primefaces component does the escapting as long as it is not activly set to false by a developer on a component.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SupportIvyTeam</dc:creator><pubDate>Fri, 04 Oct 2019 05:09:19 -0400</pubDate><guid>https://answers.axonivy.com/questions/4054/cross-site-scripting-xss/4074</guid></item><item><title>Comment by John Moser on John Moser's question</title><link>https://answers.axonivy.com/questions/4054/cross-site-scripting-xss#4061</link><description>&lt;p&gt;May be I have to ask it more generally. If I have a input field and I enter :&lt;/p&gt;
&lt;p&gt;This is my test &amp;lt;script&amp;gt;alert(123)&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;This text gets stored exactly as it is and if we use a JSF and/or Primefaces control to display it, we get a JS alert 123-dialog. &lt;/p&gt;
&lt;p&gt;So what is the Ivy approach - do I have to encode it after the text got inputed or must all text get displayed escaped. I would assume this topic has already been investigated by you and there must be some rules to follow to avoid XSS.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Moser</dc:creator><pubDate>Thu, 03 Oct 2019 10:46:18 -0400</pubDate><guid>https://answers.axonivy.com/questions/4054/cross-site-scripting-xss#4061</guid></item><item><title>Comment by Reguel Wermelinger on John Moser's question</title><link>https://answers.axonivy.com/questions/4054/cross-site-scripting-xss#4057</link><description>&lt;p&gt;I can not see an 'escape' attribute on &lt;code&gt;p:inputText&lt;/code&gt; or similar elements. To which control are you exactly referring?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Thu, 03 Oct 2019 10:05:16 -0400</pubDate><guid>https://answers.axonivy.com/questions/4054/cross-site-scripting-xss#4057</guid></item></channel></rss>