<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Paypal XSS, an IE Exclusive!</title>
	<link>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/</link>
	<description>Giorgio Maone's answers to the Web, the Universe, and Everything</description>
	<pubDate>Thu, 09 Sep 2010 15:08:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: Tom T.</title>
		<link>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-13289</link>
		<dc:creator>Tom T.</dc:creator>
		<pubDate>Mon, 15 Jun 2009 03:37:12 +0000</pubDate>
		<guid>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-13289</guid>
		<description>@Bob: Even if true, how does that refute what I said about whether popularity is the best criterion of quality? Every MS OS comes with IE OOB, and most Average Users (and corp IT, who is not always so knowledgeable and has a tendency to avoid change and extra work) plug it in, click the little &#34;e&#34;, and that's it. How does that prove it's &#34;better&#34;? Most of the AvgUserSpace doesn't even know that other browsers exist, or of the security issues.

And how have you and Bill in any way refuted the OP, about the specific vuln in IE and the general vuln in all browsers other than a NS-protected Fx?</description>
		<content:encoded><![CDATA[<p>@Bob: Even if true, how does that refute what I said about whether popularity is the best criterion of quality? Every MS OS comes with IE OOB, and most Average Users (and corp IT, who is not always so knowledgeable and has a tendency to avoid change and extra work) plug it in, click the little &quot;e&quot;, and that&#8217;s it. How does that prove it&#8217;s &quot;better&quot;? Most of the AvgUserSpace doesn&#8217;t even know that other browsers exist, or of the security issues.</p>
<p>And how have you and Bill in any way refuted the OP, about the specific vuln in IE and the general vuln in all browsers other than a NS-protected Fx?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giorgio</title>
		<link>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-13199</link>
		<dc:creator>Giorgio</dc:creator>
		<pubDate>Tue, 09 Jun 2009 10:51:56 +0000</pubDate>
		<guid>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-13199</guid>
		<description>@&lt;a href="http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-13176" rel="nofollow"&gt;Bob&lt;/a&gt;:
I don't believe Lauren's statement was so subtle, and even if it was he wouldn't be less wrong.

He (and you, apparently) failed to notice that browsers different than IE8 being immune from &lt;em&gt;this specific instance&lt;/em&gt; of DOM-based XSS is &lt;em&gt;just an accident&lt;/em&gt;, ironically due to a further bug in the Paypal code (missing URL decoding). 

The vast majority of DOM-based XSS attacks succeed equally well on IE and any other browser, except those protected by NoScript. That's what GµårÐïåñ was trying to say, I suspect.</description>
		<content:encoded><![CDATA[<p>@<a href="http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-13176" rel="nofollow">Bob</a>:<br />
I don&#8217;t believe Lauren&#8217;s statement was so subtle, and even if it was he wouldn&#8217;t be less wrong.</p>
<p>He (and you, apparently) failed to notice that browsers different than IE8 being immune from <em>this specific instance</em> of DOM-based XSS is <em>just an accident</em>, ironically due to a further bug in the Paypal code (missing URL decoding). </p>
<p>The vast majority of DOM-based XSS attacks succeed equally well on IE and any other browser, except those protected by NoScript. That&#8217;s what GµårÐïåñ was trying to say, I suspect.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob</title>
		<link>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-13176</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Sun, 07 Jun 2009 13:39:52 +0000</pubDate>
		<guid>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-13176</guid>
		<description>@Giorgio - I suspect Laurens was referring to comment #1 more than the post itself.  &#34;Hey, some software has a flaw in it - best use our product to ensure that this other software which isn't vulnerable anyway is protected.&#34;

@Tom - The link you have provided explicitly states their selection bias (i.e. extracted from their own log files, acknowledging the nature of their content), and also has this to say: &#34;You cannot - as a web developer - rely only on statistics. Statistics can often be misleading.&#34;  Their statistics show a general increase in Firefox usage, and a marked increase among Web developers - which is unsurprising given the range of functionality in Firefox and extensions that is missing from freely-available IE addons.  My own experience would suggest 80% IE is closer to the mark, and a surprising number of corporate projects still need to support IE6 (complete with broken box model).</description>
		<content:encoded><![CDATA[<p>@Giorgio - I suspect Laurens was referring to comment #1 more than the post itself.  &quot;Hey, some software has a flaw in it - best use our product to ensure that this other software which isn&#8217;t vulnerable anyway is protected.&quot;</p>
<p>@Tom - The link you have provided explicitly states their selection bias (i.e. extracted from their own log files, acknowledging the nature of their content), and also has this to say: &quot;You cannot - as a web developer - rely only on statistics. Statistics can often be misleading.&quot;  Their statistics show a general increase in Firefox usage, and a marked increase among Web developers - which is unsurprising given the range of functionality in Firefox and extensions that is missing from freely-available IE addons.  My own experience would suggest 80% IE is closer to the mark, and a surprising number of corporate projects still need to support IE6 (complete with broken box model).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob</title>
		<link>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-13175</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Sun, 07 Jun 2009 13:22:31 +0000</pubDate>
		<guid>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-13175</guid>
		<description>@#1 - I'm confused.  This exploit appears to be specific to IE8 because of the slightly-broken way it deals with URL encoding and decoding.  How exactly can an IE-specific vulnerability be justification for using a particular Firefox extension?</description>
		<content:encoded><![CDATA[<p>@#1 - I&#8217;m confused.  This exploit appears to be specific to IE8 because of the slightly-broken way it deals with URL encoding and decoding.  How exactly can an IE-specific vulnerability be justification for using a particular Firefox extension?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom  T.</title>
		<link>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12859</link>
		<dc:creator>Tom  T.</dc:creator>
		<pubDate>Sat, 23 May 2009 05:35:41 +0000</pubDate>
		<guid>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12859</guid>
		<description>#  #9  Bill says:
May 21st, 2009 at 10:46 am

IE8 is the best browser in the world. No amount of FUD will stop me or the millions of other users from using the most popular browser on earth.
********
@ Bill: Then why are you here?

Is popularity always the best criterion of quality? Are the most popular politicians, celebrities, automobiles, etc. always the best? 

And for the record, at least one source, [url]http://www.w3schools.com/browsers/browsers_stats.asp[/url], shows that for April 2009, Fx surpassed all versions of IE combined by a full five percentage points, which translates into almost 12% more users of Fx than of IE. 

Of course, you're perfectly free to continue using IE. Good luck with that. ... btw, your last name wouldn't happen to be &#34;Gates&#34;, would it? :-)</description>
		<content:encoded><![CDATA[<p>#  #9  Bill says:<br />
May 21st, 2009 at 10:46 am</p>
<p>IE8 is the best browser in the world. No amount of FUD will stop me or the millions of other users from using the most popular browser on earth.<br />
********<br />
@ Bill: Then why are you here?</p>
<p>Is popularity always the best criterion of quality? Are the most popular politicians, celebrities, automobiles, etc. always the best? </p>
<p>And for the record, at least one source, [url]http://www.w3schools.com/browsers/browsers_stats.asp[/url], shows that for April 2009, Fx surpassed all versions of IE combined by a full five percentage points, which translates into almost 12% more users of Fx than of IE. </p>
<p>Of course, you&#8217;re perfectly free to continue using IE. Good luck with that. &#8230; btw, your last name wouldn&#8217;t happen to be &quot;Gates&quot;, would it? :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nilesh Kumar</title>
		<link>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12846</link>
		<dc:creator>Nilesh Kumar</dc:creator>
		<pubDate>Fri, 22 May 2009 06:42:08 +0000</pubDate>
		<guid>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12846</guid>
		<description>Hi Giorgio,

   Thanks a lot, now things are clearer.

Can you elaborate a bit on the point:

   &#62;&#62; IS there any way to bypass this URL-encoding and execute XSS? 

No (except in IE), unless the injection point is not quoted, because quotes in an URL are usually escaped by the browser (except in IE).

Regards,
Nilesh</description>
		<content:encoded><![CDATA[<p>Hi Giorgio,</p>
<p>   Thanks a lot, now things are clearer.</p>
<p>Can you elaborate a bit on the point:</p>
<p>   &gt;&gt; IS there any way to bypass this URL-encoding and execute XSS? </p>
<p>No (except in IE), unless the injection point is not quoted, because quotes in an URL are usually escaped by the browser (except in IE).</p>
<p>Regards,<br />
Nilesh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giorgio</title>
		<link>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12827</link>
		<dc:creator>Giorgio</dc:creator>
		<pubDate>Thu, 21 May 2009 10:21:24 +0000</pubDate>
		<guid>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12827</guid>
		<description>@&lt;a href="http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12821" rel="nofollow"&gt;Nilesh&lt;/a&gt;:
&lt;blockquote&gt;What is Input Decoding? Is it same as URLEncoding?&lt;/blockquote&gt;
DOM-based XSS assumes the application processes and writes out some user input on the client side. If the input is a normal name-value pairs query string, the application script needs to
&lt;ol&gt;
&lt;li&gt;Split it in a name-value pairs list -  &lt;code&gt;var pairs = location.search.split("&#038;"&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Split each pair into name and value - &lt;code&gt;var params = {}; for each(var pair in pairs) { pair = p.split("=").map(decodeURIComponent); params[pair[0]] = params[pair[1]] };&lt;/li&gt;
&lt;/ol&gt;
At this point you've got a &lt;code&gt;params&lt;/code&gt; hash map with all the query string parameters properly &lt;em&gt;decoded&lt;/em&gt; with &lt;code&gt;decodeURIComponent()&lt;/code&gt; (url decoding).

The applications you see spitting out %22 are probably skipping the url decoding part, which is generally incorrect (especially if they actually expect special characters from the input) but incidentally makes XSS injections more difficult.

To correctly keep the decoding and being yet protected against XSS injection, you need to perform an extra &lt;em&gt;encoding&lt;/em&gt; step when outputting the data, either
&lt;ul&gt;
&lt;li&gt;Using the DOM, like 
&lt;code&gt;document.getElementById("container")
 .appendChild(document.createTextNode(params.someParam);&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;XML-escaping before writing (less recommended), like 
&lt;code&gt;function xmlEscape(s) {
  return s.replace(/[&#60;&#62;&#34;&#39;&#38;]/g, function(s) { return "&#" + s.charCodeAt(0) + ";"; });
}
document.write(xmlEscape(params.someParam));&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
IE doesn’t encode the URL?
&lt;/blockquote&gt;
No it doesn't. Therefore an application which doesn't encode its output is not protected even if it doesn't decode the input.
You should always encode the output, and decode the input if it makes sense (almost always).
&lt;blockquote&gt;
IS there any way to bypass this URL-encoding and execute XSS?
&lt;/blockquote&gt;
No (except in IE), unless the injection point is not quoted, because quotes in an URL are usually escaped by the browser (except in IE).

&lt;blockquote&gt;When should we enter any script in encoded form to execute the XSS??&lt;/blockquote&gt;
Sorry, I'm afraid I don't understand this question :(</description>
		<content:encoded><![CDATA[<p>@<a href="http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12821" rel="nofollow">Nilesh</a>:</p>
<blockquote><p>What is Input Decoding? Is it same as URLEncoding?</p></blockquote>
<p>DOM-based XSS assumes the application processes and writes out some user input on the client side. If the input is a normal name-value pairs query string, the application script needs to</p>
<ol>
<li>Split it in a name-value pairs list -
<div class="codesnip-container" >var pairs = location.search.split(&#8221;&#038;&#8221;</div>
</li>
<li>Split each pair into name and value -
<div class="codesnip-container" >var params = {}; for each(var pair in pairs) { pair = p.split(&#8221;=&#8221;).map(decodeURIComponent); params[pair[0]] = params[pair[1]] };</div>
</li>
</ol>
<p>At this point you&#8217;ve got a <code>params hash map with all the query string parameters properly <em>decoded</em> with
<div class="codesnip-container" >decodeURIComponent()</div>
<p> (url decoding).</p>
<p>The applications you see spitting out %22 are probably skipping the url decoding part, which is generally incorrect (especially if they actually expect special characters from the input) but incidentally makes XSS injections more difficult.</p>
<p>To correctly keep the decoding and being yet protected against XSS injection, you need to perform an extra <em>encoding</em> step when outputting the data, either</p>
<ul>
<li>Using the DOM, like
<div class="codesnip-container" >document.getElementById(&#8221;container&#8221;)<br />
 .appendChild(document.createTextNode(params.someParam);</div>
</li>
<li>XML-escaping before writing (less recommended), like
<div class="codesnip-container" >function xmlEscape(s) {<br />
  return s.replace(/[&#60;&#62;&#34;&#39;&#38;]/g, function(s) { return &#8220;&#&#8221; + s.charCodeAt(0) + &#8220;;&#8221;; });<br />
}<br />
document.write(xmlEscape(params.someParam));</div>
</li>
<blockquote><p>
IE doesn’t encode the URL?
</p></blockquote>
<p>No it doesn&#8217;t. Therefore an application which doesn&#8217;t encode its output is not protected even if it doesn&#8217;t decode the input.<br />
You should always encode the output, and decode the input if it makes sense (almost always).</p>
<blockquote><p>
IS there any way to bypass this URL-encoding and execute XSS?
</p></blockquote>
<p>No (except in IE), unless the injection point is not quoted, because quotes in an URL are usually escaped by the browser (except in IE).</p>
<blockquote><p>When should we enter any script in encoded form to execute the XSS??</p></blockquote>
<p>Sorry, I&#8217;m afraid I don&#8217;t understand this question :(</ul>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12826</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Thu, 21 May 2009 08:46:56 +0000</pubDate>
		<guid>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12826</guid>
		<description>IE8 is the best browser in the world. No amount of FUD will stop me or the millions of other users from using the most popular browser on earth.</description>
		<content:encoded><![CDATA[<p>IE8 is the best browser in the world. No amount of FUD will stop me or the millions of other users from using the most popular browser on earth.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nilesh</title>
		<link>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12821</link>
		<dc:creator>Nilesh</dc:creator>
		<pubDate>Thu, 21 May 2009 05:49:42 +0000</pubDate>
		<guid>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12821</guid>
		<description>Dear Giorgio,
   First of all really thanks for your quick answer.You are so humble. I appreciate this.  

Regarding your reply I have few questions again:

&#62;&#62;You’re talking about a different application, right?
&#62;&#62;In the Paypal case, it’s not doing output encoding, it’s skipping &#62;&#62;input decoding (quite strangely)

I am talking about any general application I find that entering scripts in original form it gives back URL encoded form as output of the script.
What is Input Decoding? Is it same as URLEncoding? 

&#62;&#62;only by luck the fact browsers different by IE properly encode the &#62;&#62;URL saves them from XSS

IE doesn't encode the URL?

&#62;&#62;So is your application actually url-encoding its output (which is &#62;&#62;wrong, since it should HTML-encode instead)

IS there any way to bypass this URL-encoding and execute XSS?

And last but not least:

When should we enter any script in encoded form to execute the XSS??

Thanks,
Nilesh
nileshkumar83.blogspot.com</description>
		<content:encoded><![CDATA[<p>Dear Giorgio,<br />
   First of all really thanks for your quick answer.You are so humble. I appreciate this.  </p>
<p>Regarding your reply I have few questions again:</p>
<p>&gt;&gt;You’re talking about a different application, right?<br />
&gt;&gt;In the Paypal case, it’s not doing output encoding, it’s skipping &gt;&gt;input decoding (quite strangely)</p>
<p>I am talking about any general application I find that entering scripts in original form it gives back URL encoded form as output of the script.<br />
What is Input Decoding? Is it same as URLEncoding? </p>
<p>&gt;&gt;only by luck the fact browsers different by IE properly encode the &gt;&gt;URL saves them from XSS</p>
<p>IE doesn&#8217;t encode the URL?</p>
<p>&gt;&gt;So is your application actually url-encoding its output (which is &gt;&gt;wrong, since it should HTML-encode instead)</p>
<p>IS there any way to bypass this URL-encoding and execute XSS?</p>
<p>And last but not least:</p>
<p>When should we enter any script in encoded form to execute the XSS??</p>
<p>Thanks,<br />
Nilesh<br />
nileshkumar83.blogspot.com</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giorgio</title>
		<link>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12800</link>
		<dc:creator>Giorgio</dc:creator>
		<pubDate>Wed, 20 May 2009 14:49:36 +0000</pubDate>
		<guid>http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12800</guid>
		<description>@&lt;a href="http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12788" rel="nofollow"&gt;Nilesh&lt;/a&gt;:
You're talking about a different application, right?
In the Paypal case, it's not doing output encoding, it's skipping input decoding (quite strangely).
The correct workflow should be:
&lt;ol&gt;
&lt;li&gt;Input decoding (decodeURIComponent)&lt;/li&gt;
&lt;li&gt;Input validation&lt;/li&gt;
&lt;li&gt;Output with output-specific (HTML or JavaScript) encoding&lt;/li&gt;
&lt;/ol&gt;
This Paypal page was missing all the 3, and only by luck the fact browsers different by IE properly encode the URL saves them from XSS.

So is your application actually url-encoding its output (which is wrong, since it should HTML-encode instead), or is it just omitting to decode its input like Paypal? In the latter case, it would be as exploitable as Paypal against IE users.</description>
		<content:encoded><![CDATA[<p>@<a href="http://hackademix.net/2009/05/19/paypal-xss-an-ie-exclusive/#comment-12788" rel="nofollow">Nilesh</a>:<br />
You&#8217;re talking about a different application, right?<br />
In the Paypal case, it&#8217;s not doing output encoding, it&#8217;s skipping input decoding (quite strangely).<br />
The correct workflow should be:</p>
<ol>
<li>Input decoding (decodeURIComponent)</li>
<li>Input validation</li>
<li>Output with output-specific (HTML or JavaScript) encoding</li>
</ol>
<p>This Paypal page was missing all the 3, and only by luck the fact browsers different by IE properly encode the URL saves them from XSS.</p>
<p>So is your application actually url-encoding its output (which is wrong, since it should HTML-encode instead), or is it just omitting to decode its input like Paypal? In the latter case, it would be as exploitable as Paypal against IE users.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
