<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Web 2.0 is vulnerable to attack</title>
	<atom:link href="http://www.jeremyprivett.com/blog/archives/web-20-is-vulnerable-to-attack/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeremyprivett.com/blog/archives/web-20-is-vulnerable-to-attack/</link>
	<description>Programming and Life</description>
	<lastBuildDate>Tue, 29 Sep 2009 22:01:20 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Lewis</title>
		<link>http://www.jeremyprivett.com/blog/archives/web-20-is-vulnerable-to-attack/comment-page-1/#comment-4896</link>
		<dc:creator>Lewis</dc:creator>
		<pubDate>Wed, 04 Apr 2007 21:22:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeremyprivett.com/archives/web-20-is-vulnerable-to-attack/#comment-4896</guid>
		<description>Also, I just thought I&#039;d post the best solution to the CRSF hack (which will effectively fix the JSON array hack since the request will never be accepted).

&lt;blockquote&gt;The CSRF attack works by subverting what the browser will do with the cookie.  Ideally, your cookies would be totally unavailable to anyone outside of your domain. This attack works because XMLHttpRequest in some page can use the cookies of some foreign domain when posting to that foreign domain. However the script can not read the cookie directly due to the cross-domain rules, so a slight modification of the hidden field solution is to read the session cookie using JavaScript and then adding to URLs, forms or the body of a POST request, and then checking in the server that the session cookie value that the browser sends in the header (which is subvertable) is the same as the session cookie in the request (this is not subvertable in the same way).

If you are using Ajax or a significant amount of scripting then this solution is a simple fix once solution.&lt;/blockquote&gt;

Basically, a piece of Javascript grabs the cookie information and sends it as a post/url to the submitting page. Because the hacker can&#039;t actually get the cookie information, they can&#039;t send the cookie information as the url/post. You then check the submitted data with the actual cookies, and if they don&#039;t match you unset() the cookie or whatever. At least that&#039;s how I think it works.</description>
		<content:encoded><![CDATA[<p>Also, I just thought I&#8217;d post the best solution to the CRSF hack (which will effectively fix the JSON array hack since the request will never be accepted).</p>
<blockquote><p>The CSRF attack works by subverting what the browser will do with the cookie.  Ideally, your cookies would be totally unavailable to anyone outside of your domain. This attack works because XMLHttpRequest in some page can use the cookies of some foreign domain when posting to that foreign domain. However the script can not read the cookie directly due to the cross-domain rules, so a slight modification of the hidden field solution is to read the session cookie using JavaScript and then adding to URLs, forms or the body of a POST request, and then checking in the server that the session cookie value that the browser sends in the header (which is subvertable) is the same as the session cookie in the request (this is not subvertable in the same way).</p>
<p>If you are using Ajax or a significant amount of scripting then this solution is a simple fix once solution.</p></blockquote>
<p>Basically, a piece of Javascript grabs the cookie information and sends it as a post/url to the submitting page. Because the hacker can&#8217;t actually get the cookie information, they can&#8217;t send the cookie information as the url/post. You then check the submitted data with the actual cookies, and if they don&#8217;t match you unset() the cookie or whatever. At least that&#8217;s how I think it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lewis</title>
		<link>http://www.jeremyprivett.com/blog/archives/web-20-is-vulnerable-to-attack/comment-page-1/#comment-4891</link>
		<dc:creator>Lewis</dc:creator>
		<pubDate>Wed, 04 Apr 2007 21:10:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeremyprivett.com/archives/web-20-is-vulnerable-to-attack/#comment-4891</guid>
		<description>Ok I did a bit of research, and here&#039;s what it is:

1. The &lt;a href=&quot;http://getahead.org/blog/joe/2007/01/01/csrf_attacks_or_how_to_avoid_exposing_your_gmail_contacts.html&quot; rel=&quot;nofollow&quot;&gt;CRSF hack&lt;/a&gt; allows you to make an iframe that will allow you to perform requests on sites (and so it sends the cookies and authenticates you). By the cookie spec, this shouldn&#039;t be allowed but to most modern browsers do this anyway.
2. Although the browser lets you send the request, cross domain rules prevent you from reading the response (the contents of the iFrame).
3. However, because JSON is Javascript that is eval()ed, it is eval()ed and then the response is thrown away.

So far, no harm (apart from sending the request in the first place :P). But the problem is, Javascript&#039;s core functionality can be changed. Most importantly, the array/object constructor can be changed. This means that when the JSON is eval()ed, you can manipulate the array constructor to still pass the response before it&#039;s thrown away. Thus allowing sensitive data to be taken.</description>
		<content:encoded><![CDATA[<p>Ok I did a bit of research, and here&#8217;s what it is:</p>
<p>1. The <a href="http://getahead.org/blog/joe/2007/01/01/csrf_attacks_or_how_to_avoid_exposing_your_gmail_contacts.html" rel="nofollow">CRSF hack</a> allows you to make an iframe that will allow you to perform requests on sites (and so it sends the cookies and authenticates you). By the cookie spec, this shouldn&#8217;t be allowed but to most modern browsers do this anyway.<br />
2. Although the browser lets you send the request, cross domain rules prevent you from reading the response (the contents of the iFrame).<br />
3. However, because JSON is Javascript that is eval()ed, it is eval()ed and then the response is thrown away.</p>
<p>So far, no harm (apart from sending the request in the first place <img src='http://www.jeremyprivett.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ). But the problem is, Javascript&#8217;s core functionality can be changed. Most importantly, the array/object constructor can be changed. This means that when the JSON is eval()ed, you can manipulate the array constructor to still pass the response before it&#8217;s thrown away. Thus allowing sensitive data to be taken.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lewis</title>
		<link>http://www.jeremyprivett.com/blog/archives/web-20-is-vulnerable-to-attack/comment-page-1/#comment-4649</link>
		<dc:creator>Lewis</dc:creator>
		<pubDate>Wed, 04 Apr 2007 09:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeremyprivett.com/archives/web-20-is-vulnerable-to-attack/#comment-4649</guid>
		<description>Okey poke. Would be interesting to know.</description>
		<content:encoded><![CDATA[<p>Okey poke. Would be interesting to know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.jeremyprivett.com/blog/archives/web-20-is-vulnerable-to-attack/comment-page-1/#comment-4083</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Mon, 02 Apr 2007 20:15:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeremyprivett.com/archives/web-20-is-vulnerable-to-attack/#comment-4083</guid>
		<description>I&#039;m going to keep a lookout for the whitepaper mentioned in the article. I&#039;ll put a link up to it when I find it, or if someone else could pass it along, that would be great. I was confused at first, myself, and I would say how I think it works... But, I&#039;m going to read the whitepaper first to make sure I&#039;m not completely off-base.

I&#039;ll put up more details as I see them.</description>
		<content:encoded><![CDATA[<p>I&#8217;m going to keep a lookout for the whitepaper mentioned in the article. I&#8217;ll put a link up to it when I find it, or if someone else could pass it along, that would be great. I was confused at first, myself, and I would say how I think it works&#8230; But, I&#8217;m going to read the whitepaper first to make sure I&#8217;m not completely off-base.</p>
<p>I&#8217;ll put up more details as I see them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lewis</title>
		<link>http://www.jeremyprivett.com/blog/archives/web-20-is-vulnerable-to-attack/comment-page-1/#comment-4082</link>
		<dc:creator>Lewis</dc:creator>
		<pubDate>Mon, 02 Apr 2007 20:07:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeremyprivett.com/archives/web-20-is-vulnerable-to-attack/#comment-4082</guid>
		<description>I don&#039;t understand, it&#039;s impossible to send an AJAX request to a domain other than the current domain. The only exception to this is using iFrames but that&#039;s an old vulnerability and is how the sausage attack works. I don&#039;t see how JSON has any difference? JSON is used to communicate from the server to the browser, and only the server has control over that.

It doesn&#039;t make sense.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t understand, it&#8217;s impossible to send an AJAX request to a domain other than the current domain. The only exception to this is using iFrames but that&#8217;s an old vulnerability and is how the sausage attack works. I don&#8217;t see how JSON has any difference? JSON is used to communicate from the server to the browser, and only the server has control over that.</p>
<p>It doesn&#8217;t make sense.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
