<?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"
	>
<channel>
	<title>Comments on: Fortify JavaScript Hijacking FUD</title>
	<atom:link href="http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/feed/" rel="self" type="application/rss+xml" />
	<link>http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/</link>
	<description>Bob's Rants</description>
	<pubDate>Fri, 16 May 2008 17:08:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: bob</title>
		<link>http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/#comment-11466</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Tue, 24 Jul 2007 07:16:58 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/?p=224#comment-11466</guid>
		<description>The same origin policy is not there to protect someone from themselves, but to protect them from going to a third party site and unknowingly having bad things happen. There are an infinite number of ways you could do "bad" things if you had full control over the computer in question.</description>
		<content:encoded><![CDATA[<p>The same origin policy is not there to protect someone from themselves, but to protect them from going to a third party site and unknowingly having bad things happen. There are an infinite number of ways you could do &#8220;bad&#8221; things if you had full control over the computer in question.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/#comment-11465</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Tue, 24 Jul 2007 06:28:13 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/?p=224#comment-11465</guid>
		<description>While I have not researched this whole discussion in depth, I am inclined to agree with you at this point.  However, I have thought about the "same origin policy" before and have a question that, again, I have not researched nor tested.  If I am not mistaken, the "same origin" is based on the domain name of the resources in question.  Let's say I find a server/page that I wanted to initiate a scripting attack against (as in post 14).  I also get the IP address that the domain is pointing to (for use in just a minute).  Now I disconnect from the Net, create a web site on my local server with the domain name in question, add the IP address to my NIC and point it to the site on my local server.  I create a page that has an iframe with the src pointing to the page I want to attack (which I have also created on my local server).  The containing page (not the iframe src) has the necessary script, etc. to launch the attack and the iframe is pointing to a "same origin" resource since they both reside on my local server.  I fire up my browser point to the spoofed page.  The "gun is loaded" but it is "aimed" at my local server, which does not do much good.  So what do I do?  I take my local server offline and reconnect to the Net so that the domain and IP will resolve at the original server.  Now the "gun" is aimed at the server I want to attack.  I click on the "Fire" button and the script runs and launches my attack, which the browser and the server think is OK because everything is "same origin".  Since I not only spoofed the domain name but the IP as well, there is no way that either party involved (my browser nor the other server) knows that the pages actually originated elsewhere.  It seems such an easy way to circumvent the "same origin" policy that I hope I am just not educated well enough to understand what would stop that.  Either that, or the FBI / CIA is going to be knocking on my door in the next day or two.  :-) (I swear, I have never tried this.  Obviously, because if I had and was "blocked" I would know that it is not possible.  Alternatively, if I knew my idea would work, do think I would be posting it in a public forum like this?)</description>
		<content:encoded><![CDATA[<p>While I have not researched this whole discussion in depth, I am inclined to agree with you at this point.  However, I have thought about the &#8220;same origin policy&#8221; before and have a question that, again, I have not researched nor tested.  If I am not mistaken, the &#8220;same origin&#8221; is based on the domain name of the resources in question.  Let&#8217;s say I find a server/page that I wanted to initiate a scripting attack against (as in post 14).  I also get the IP address that the domain is pointing to (for use in just a minute).  Now I disconnect from the Net, create a web site on my local server with the domain name in question, add the IP address to my NIC and point it to the site on my local server.  I create a page that has an iframe with the src pointing to the page I want to attack (which I have also created on my local server).  The containing page (not the iframe src) has the necessary script, etc. to launch the attack and the iframe is pointing to a &#8220;same origin&#8221; resource since they both reside on my local server.  I fire up my browser point to the spoofed page.  The &#8220;gun is loaded&#8221; but it is &#8220;aimed&#8221; at my local server, which does not do much good.  So what do I do?  I take my local server offline and reconnect to the Net so that the domain and IP will resolve at the original server.  Now the &#8220;gun&#8221; is aimed at the server I want to attack.  I click on the &#8220;Fire&#8221; button and the script runs and launches my attack, which the browser and the server think is OK because everything is &#8220;same origin&#8221;.  Since I not only spoofed the domain name but the IP as well, there is no way that either party involved (my browser nor the other server) knows that the pages actually originated elsewhere.  It seems such an easy way to circumvent the &#8220;same origin&#8221; policy that I hope I am just not educated well enough to understand what would stop that.  Either that, or the FBI / CIA is going to be knocking on my door in the next day or two.  :-) (I swear, I have never tried this.  Obviously, because if I had and was &#8220;blocked&#8221; I would know that it is not possible.  Alternatively, if I knew my idea would work, do think I would be posting it in a public forum like this?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/#comment-10101</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Fri, 20 Apr 2007 16:30:51 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/?p=224#comment-10101</guid>
		<description>The browser's same origin policy guarantees it.</description>
		<content:encoded><![CDATA[<p>The browser&#8217;s same origin policy guarantees it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mario</title>
		<link>http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/#comment-10099</link>
		<dc:creator>mario</dc:creator>
		<pubDate>Fri, 20 Apr 2007 09:10:15 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/?p=224#comment-10099</guid>
		<description>How json-particular is this hijacking trick? I wonder, couldn't a similar technique be applied to a callback service that returned data in xml? If instead of using a script one where to use an iframe with an src pointing towards the service to be hijacked. The returned xml would be (let's assume a very tolerant x/html doctype) inlined into the dom? What is then to stop the malicious page from manipulating that dom, and ajaxing the hijacked data off to another server? This *should* not work... what guarantees that it does not?</description>
		<content:encoded><![CDATA[<p>How json-particular is this hijacking trick? I wonder, couldn&#8217;t a similar technique be applied to a callback service that returned data in xml? If instead of using a script one where to use an iframe with an src pointing towards the service to be hijacked. The returned xml would be (let&#8217;s assume a very tolerant x/html doctype) inlined into the dom? What is then to stop the malicious page from manipulating that dom, and ajaxing the hijacked data off to another server? This *should* not work&#8230; what guarantees that it does not?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/#comment-10097</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Thu, 19 Apr 2007 07:34:52 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/?p=224#comment-10097</guid>
		<description>The solution is to make JSON producers warn if they're serializing an array envelope. It's not anything like telling developers not to code buffer overflows. It's like telling them not to use eval.

NOTHING MochiKit can do is insecure (in this way). Whatever the client sends or decodes is irrelevant. It's a 100% server-side issue. I added comment stripping support so that people would shut up, not because it's useful in theory or practice.

Tricking a JS implementation to deserialize invalid JavaScript syntax (an object envelope) is just as intractable as getting one to strip comments or a while (1). It doesn't even parse, the grammar does not allow it. I don't care how tenacious hacker is, they would need a full text exploit vector to do it, which makes it exactly as secure as any of the other proposed solutions except it's infinitely easier to implement since it does not require a new specification or any implementation changes.</description>
		<content:encoded><![CDATA[<p>The solution is to make JSON producers warn if they&#8217;re serializing an array envelope. It&#8217;s not anything like telling developers not to code buffer overflows. It&#8217;s like telling them not to use eval.</p>
<p>NOTHING MochiKit can do is insecure (in this way). Whatever the client sends or decodes is irrelevant. It&#8217;s a 100% server-side issue. I added comment stripping support so that people would shut up, not because it&#8217;s useful in theory or practice.</p>
<p>Tricking a JS implementation to deserialize invalid JavaScript syntax (an object envelope) is just as intractable as getting one to strip comments or a while (1). It doesn&#8217;t even parse, the grammar does not allow it. I don&#8217;t care how tenacious hacker is, they would need a full text exploit vector to do it, which makes it exactly as secure as any of the other proposed solutions except it&#8217;s infinitely easier to implement since it does not require a new specification or any implementation changes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fk</title>
		<link>http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/#comment-10096</link>
		<dc:creator>fk</dc:creator>
		<pubDate>Thu, 19 Apr 2007 07:17:28 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/?p=224#comment-10096</guid>
		<description>&#62;I offered a much simpler solution that is secure and is still valid JSON and requires no changes to any client, simply 
&#62; restricting the response to a particular (and already extremely common) subset of JSON is sufficient.

(Assuming your solution is telling users to only use plain objects)

That's like telling developers not to code buffer overflows.  We all see how well that works...  As a framework provider, if you're capable of distributing a framework that helps in making code more secure, why wouldn't you? (Yes, I know you have patched after being nagged to death by your users.) 

All too often devs that nit pick security issues are proven wrong time and time again by tenacious hackers.  Error on the safe side.</description>
		<content:encoded><![CDATA[<p>&gt;I offered a much simpler solution that is secure and is still valid JSON and requires no changes to any client, simply<br />
&gt; restricting the response to a particular (and already extremely common) subset of JSON is sufficient.</p>
<p>(Assuming your solution is telling users to only use plain objects)</p>
<p>That&#8217;s like telling developers not to code buffer overflows.  We all see how well that works&#8230;  As a framework provider, if you&#8217;re capable of distributing a framework that helps in making code more secure, why wouldn&#8217;t you? (Yes, I know you have patched after being nagged to death by your users.) </p>
<p>All too often devs that nit pick security issues are proven wrong time and time again by tenacious hackers.  Error on the safe side.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/#comment-10094</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Wed, 18 Apr 2007 17:38:43 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/?p=224#comment-10094</guid>
		<description>Brian, are you literate? It certainly doesn't seem like you actually read the post. I'm well aware of what secure code is and how it's done and that's not what bothers me about you, your paper, and the reaction to it.

Why the hell should there be security documentation in client frameworks? The security documentation should be in the web frameworks, because that's where it needs to be implemented. Any security documentation with client frameworks would be purely supplemental.

I offered a much simpler solution that is secure and is still valid JSON and requires no changes to any client, simply restricting the response to a particular (and already extremely common) subset of JSON is sufficient.

The representation offered by Yahoo is explicitly for cross-domain use, I don't see relevancy.</description>
		<content:encoded><![CDATA[<p>Brian, are you literate? It certainly doesn&#8217;t seem like you actually read the post. I&#8217;m well aware of what secure code is and how it&#8217;s done and that&#8217;s not what bothers me about you, your paper, and the reaction to it.</p>
<p>Why the hell should there be security documentation in client frameworks? The security documentation should be in the web frameworks, because that&#8217;s where it needs to be implemented. Any security documentation with client frameworks would be purely supplemental.</p>
<p>I offered a much simpler solution that is secure and is still valid JSON and requires no changes to any client, simply restricting the response to a particular (and already extremely common) subset of JSON is sufficient.</p>
<p>The representation offered by Yahoo is explicitly for cross-domain use, I don&#8217;t see relevancy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Chess</title>
		<link>http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/#comment-10093</link>
		<dc:creator>Brian Chess</dc:creator>
		<pubDate>Wed, 18 Apr 2007 17:30:58 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/?p=224#comment-10093</guid>
		<description>Hi Bob, I'm Brian Chess, one of the authors of the JavaScript Hijacking paper.  You sound a little bitter.  I can't say I blame you.  Programming is easier when you don't have to think about security, and the Ajax community has gotten away without thinking very much about security for a few years now.  Want some evidence?  Go look at the documentation for any of the major frameworks that shows programmers how to use the framework in a secure way.  It won't take you long to read because there's pretty much zero.

We'd like to get Ajax programmers having explicit conversations about security *now* so that we don't have another mess to clean up starting in a few years after people have unknowingly written a tremendous amount of vulnerable code.

As for your critique, I think you've fallen into a number of common boondoggles.  First, we're talking about JavaScript Hijacking, not JSON hijacking.  JSON is not the only way people are using JavaScript as a data transport format.  Take a look at the JSArray representation offered by Yahoo (vulnerable) or the pre-2.0 DWR callback format (highly vulnerable).

Another common mistake is to believe that the client-side frameworks have nothing to do with the security of the server.  It's sort of like saying that your peer group has nothing to do with your behavior.  If the client side frameworks continue to support dangerous practices without any warning to the programmer, they are at best complicit in the creation of vulnerable software.  Used in their default configuration, some client-side frameworks (MochiKit is a prime example) actually *require* the creation of a vulnerable server.

I do think it's reasonable to consider alternatives to the fixes that we proposed.  Changing JSON so that it explicitly made provisions for security would be great.  At the same time, people are using JSON as it exists today, and they deserve to understand the security risks they face. 

Thanks,
Brian</description>
		<content:encoded><![CDATA[<p>Hi Bob, I&#8217;m Brian Chess, one of the authors of the JavaScript Hijacking paper.  You sound a little bitter.  I can&#8217;t say I blame you.  Programming is easier when you don&#8217;t have to think about security, and the Ajax community has gotten away without thinking very much about security for a few years now.  Want some evidence?  Go look at the documentation for any of the major frameworks that shows programmers how to use the framework in a secure way.  It won&#8217;t take you long to read because there&#8217;s pretty much zero.</p>
<p>We&#8217;d like to get Ajax programmers having explicit conversations about security *now* so that we don&#8217;t have another mess to clean up starting in a few years after people have unknowingly written a tremendous amount of vulnerable code.</p>
<p>As for your critique, I think you&#8217;ve fallen into a number of common boondoggles.  First, we&#8217;re talking about JavaScript Hijacking, not JSON hijacking.  JSON is not the only way people are using JavaScript as a data transport format.  Take a look at the JSArray representation offered by Yahoo (vulnerable) or the pre-2.0 DWR callback format (highly vulnerable).</p>
<p>Another common mistake is to believe that the client-side frameworks have nothing to do with the security of the server.  It&#8217;s sort of like saying that your peer group has nothing to do with your behavior.  If the client side frameworks continue to support dangerous practices without any warning to the programmer, they are at best complicit in the creation of vulnerable software.  Used in their default configuration, some client-side frameworks (MochiKit is a prime example) actually *require* the creation of a vulnerable server.</p>
<p>I do think it&#8217;s reasonable to consider alternatives to the fixes that we proposed.  Changing JSON so that it explicitly made provisions for security would be great.  At the same time, people are using JSON as it exists today, and they deserve to understand the security risks they face. </p>
<p>Thanks,<br />
Brian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/#comment-10088</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Sat, 14 Apr 2007 21:25:36 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/?p=224#comment-10088</guid>
		<description>You are splitting hairs... JSON is a serialized representation of a data structure too, and it's equivalent to XML (anything you do with XML you can do with JSON and vice versa).</description>
		<content:encoded><![CDATA[<p>You are splitting hairs&#8230; JSON is a serialized representation of a data structure too, and it&#8217;s equivalent to XML (anything you do with XML you can do with JSON and vice versa).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Liam Quin</title>
		<link>http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/#comment-10087</link>
		<dc:creator>Liam Quin</dc:creator>
		<pubDate>Sat, 14 Apr 2007 20:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://bob.pythonmac.org/?p=224#comment-10087</guid>
		<description>whopee - XML isn't a data structure, and doesn't define one.  So they are right.

XML is a serialized representation of structured information.  Since a data structure is an (non-serialized) example of structured information, you can represent arbitrary data structures in XML, with more or less work, but the resulting XML is a serialized representation of the data structure, it is not the data structure.  If it sounds like I'm splitting hairs, consider the difference between a photograph of a gun and a gun :-)

Liam (W3C XML Avtivity Lead</description>
		<content:encoded><![CDATA[<p>whopee - XML isn&#8217;t a data structure, and doesn&#8217;t define one.  So they are right.</p>
<p>XML is a serialized representation of structured information.  Since a data structure is an (non-serialized) example of structured information, you can represent arbitrary data structures in XML, with more or less work, but the resulting XML is a serialized representation of the data structure, it is not the data structure.  If it sounds like I&#8217;m splitting hairs, consider the difference between a photograph of a gun and a gun :-)</p>
<p>Liam (W3C XML Avtivity Lead</p>
]]></content:encoded>
	</item>
</channel>
</rss>
