A: This is a software problem. It won't be fixed until programmers fix it. The reason we're talking about it is to try to raise awareness among the Ajax development community.
A: The Same Origin Policy implemented by all major web browsers is designed to prevent parsing the results of a CSRF attack. JavaScript Hijacking takes advantage of a hole in the Single Origin Policy. In many cases, allowing an attacker to both read and write data is significantly worse than simply allowing them to make illegitimate requests.
A: Not so. One of the most important things to note about JavaScript Hijacking is that it does not require the presence of another defect.
A: The only data we could find on this subject suggest that 25% of Ajax programmers are rolling their own. Scary!
A: The paper does not make that claim. Many of the client-side frameworks default to sending HTTP POST requests, which is a poor defense, but does not require the server to be vulnerable. We only characterize a framework as requiring a server to be vulnerable if it defaults to using HTTP GET and provides no defense against JavaScript Hijacking. When we first wrote the paper, none of the client side frameworks did anything to explain the problem to their users or to prevent a programmer from using the framework in a vulnerable way. We're happy to see that that's changing rapidly.
A: The JSON parser from json.org eventually calls eval(), but it doesn't really matter. Calling eval() is not a prerequisite to being vulnerable. All you have to do is create an object, so the problem exists no matter how you parse the JSON.
A: This is entirely dependent upon the type of objects that the application is communicating. Array syntax is natural for communicating lists and other collections, and if the outermost structure is an array, all of the contents of the array are vulnerable. If the security of your program depends on your choice of data structures, you're on thin ice.
A: We did our best to give credit to relevant prior work, including Grossman's Google attack and Joe Walker's comments on JSON. What we think is new in the paper is:
A: While it is true that the client can see any messages the server sends, this is not the scenario where JavaScript Hijacking applies. JavaScript Hijacking involves a vulnerable Web site, a victim with a Web browser, and a malicious Web site. The malicious Web site can use JavaScript hijacking to steal the victim's data from the vulnerable web site. Web browsers prevent this in most cases, but the browser makers did not anticipate the use of JavaScript to communicate confidential data.
A: The paper focuses on JSON because it is currently the most widely used data transport format that makes use of JavaScript syntax. Other formats that use JavaScript syntax are potentially vulnerable too, but XML is not vulnerable; the popular browsers correctly apply the Same Origin Policy to protect XML.
A: Over the last year or two, there has been a lot of work on increasingly sophisticated techniques for exploiting vulnerabilities such as cross-site scripting. Much of this work is drawing on the same kinds of JavaScript techniques that are being used to build Ajax applications. Di Paola and Fedon's "Subverting Ajax" paper is a great example. However, JavaScript Hijacking is fundamentally different. It does not piggyback on a cross-site scripting vulnerability. It works against applications that were previously widely considered to be reasonably secure.
A: Checking for application/json in the content-type header is not enough to prevent JavaScript hijacking. An attacker can simply request the data twice.
Here's a two-step attack that bypasses the check: