<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Are the following characters XSS vulnerable? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/are-the-following-characters-xss-vulnerable/m-p/251874#M205004</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The answer is very much "it depends"…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- It depends what code is consuming the user input&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- It depends whether you want to display the user input back to the user&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- It depends whether you want to POST the input, or include it on a URL&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have a client-side function called Alfresco.util.encodeHTML() which will make any string safe to display on a web page. there is also the JavaScript function encodeURIComponent() should you need to put these strings on a URL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There's no definitive list of dangerous characters, simply because we don't know what you're ultimately doing with that user input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Mar 2012 12:47:58 GMT</pubDate>
    <dc:creator>mikeh</dc:creator>
    <dc:date>2012-03-30T12:47:58Z</dc:date>
    <item>
      <title>Are the following characters XSS vulnerable?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/are-the-following-characters-xss-vulnerable/m-p/251873#M205003</link>
      <description>Hi,&amp;nbsp;&amp;nbsp; We are trying to implement security in our application, wherein we need to encode and decode the user inputs.So can anybody please provide me a list of all the characters that are disallowed or dangerous, that I need to encode?For eg. for "&amp;lt;" character we use &amp;amp;lt;, for "&amp;gt;" character</description>
      <pubDate>Fri, 30 Mar 2012 12:36:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/are-the-following-characters-xss-vulnerable/m-p/251873#M205003</guid>
      <dc:creator>neufmartial</dc:creator>
      <dc:date>2012-03-30T12:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Are the following characters XSS vulnerable?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/are-the-following-characters-xss-vulnerable/m-p/251874#M205004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The answer is very much "it depends"…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- It depends what code is consuming the user input&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- It depends whether you want to display the user input back to the user&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- It depends whether you want to POST the input, or include it on a URL&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have a client-side function called Alfresco.util.encodeHTML() which will make any string safe to display on a web page. there is also the JavaScript function encodeURIComponent() should you need to put these strings on a URL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There's no definitive list of dangerous characters, simply because we don't know what you're ultimately doing with that user input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 12:47:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/are-the-following-characters-xss-vulnerable/m-p/251874#M205004</guid>
      <dc:creator>mikeh</dc:creator>
      <dc:date>2012-03-30T12:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Are the following characters XSS vulnerable?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/are-the-following-characters-xss-vulnerable/m-p/251875#M205005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello MikeH,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the quick reply. Yes, we do want to display the code to the user. In our application, we will be taking user input, then we are encoding the user input with certain characters, which is listed below. Then this encoded value will be inserted in the Database. There are several places in application where we will be displaying this encoded vale i.e. user input, to the user. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[1] | (pipe sign)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[2] &amp;amp; (ampersand sign)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[3] ; (semicolon sign)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[4] $ (dollar sign)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[5] % (percent sign)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[6] @ (at sign)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[7] ' (single apostrophe)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[8] " (quotation mark)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[9] \' (backslash-escaped apostrophe)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[10] \" (backslash-escaped quotation mark)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[11] &amp;lt;&amp;gt; (triangular parenthesis)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[12] () (parenthesis)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[13] + (plus sign)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[14] CR (Carriage return, ASCII 0x0d)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[15] LF (Line feed, ASCII 0x0a)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[16] , (comma sign)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[17] \ (backslash)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So if the user enter's something malicious string or code, then that string will be searched for a list of characters like "&amp;lt;", "&amp;gt;" etc. listed below. If a match is found then it will be encoded.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We were using AppScan tool to test our application, and found that there are 17 characters which are vulnerable to XSS, so we must encode them. Please see the following link for the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.51testing.com/?uid-13997-action-viewspace-itemid-77651" rel="nofollow noopener noreferrer"&gt;http://www.51testing.com/?uid-13997-action-viewspace-itemid-77651&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I need to find if there are any other disallowed characters which may be vulnerable to XSS. So after googling out, I have found above characters, but I need to be sure that we will need to encode them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know that there are many pre-defined function available to encode, like one you said the JavaScript function encodeURIComponent(), but in our application we will be maintaining a whitelist of characters which will be stored in Database something like following.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[&amp;lt; &amp;amp;lt;],[&amp;gt; &amp;amp;gt;], and so on for other characters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here "[]"(square brackets) are used to contain the vulnerable characters. it contains the characters followed by space, and then followed by Html entity code for the character. So [&amp;lt; &amp;amp;lt;] contains less than(&amp;lt;) character followed by its Html Entity code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So when the application starts, the application will query the Database to get all the characters, and keep them in a map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So when the user inputs something, the application will check the string against the characters in the map, and if a match is found, then replace the character with its equivalent Html entity code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I have been asked to find out any other characters apart from 17 listed above, that will be vulnerable to XSS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dines&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 14:58:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/are-the-following-characters-xss-vulnerable/m-p/251875#M205005</guid>
      <dc:creator>neufmartial</dc:creator>
      <dc:date>2012-03-30T14:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Are the following characters XSS vulnerable?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/are-the-following-characters-xss-vulnerable/m-p/251876#M205006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;From that article, you don't need to filter out all those characters if you're just worried about XSS. From an Alfresco Share point of view, using the encodeHTML() function I mentioned above should be sufficient for user-visible strings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note if you use the Alfresco APIs rather than trying to access the database directly (we strongly recommend you stay away from the database itself) then you also won't be open to SQL injection attacks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It sounds a little like you've got your own web app - perhaps using Alfresco as a headless repository? In that case you would probably be wise to employ a specialist web security consultant to test your app before making it live.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 16:08:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/are-the-following-characters-xss-vulnerable/m-p/251876#M205006</guid>
      <dc:creator>mikeh</dc:creator>
      <dc:date>2012-03-30T16:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Are the following characters XSS vulnerable?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/are-the-following-characters-xss-vulnerable/m-p/251877#M205007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Mike,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the reply. Actually I am working for a company, where we already have a web application. Now we are trying to implement security in our application. We won't be using any open source API for that, since this decision has already been taken, and its not in my hands. Somebody had done initial analysis using AppScan tool, and found the 17 characters mentioned in the link. Now my manager has asked me to find any additional characters that we will need to encode. So I am just googling out to find any such characters. I have found the characters, that I have mentioned in my earlier post. But I need to confirm those characters. I don't need to encode them, since that part is handled by different team. I just need to provide them my analysis, stating any other disallowed characters, apart from 17 characters mentioned in AppScan test.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dinesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Mar 2012 17:02:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/are-the-following-characters-xss-vulnerable/m-p/251877#M205007</guid>
      <dc:creator>neufmartial</dc:creator>
      <dc:date>2012-03-31T17:02:05Z</dc:date>
    </item>
  </channel>
</rss>

