Re:Why does Google append while(1); in front of their JSON r...
by hendi_ on Tuesday February 05, 2013 @05:06AM
(#5169964)
You're right, I only focused on that one single reason for my post since I was in a hurry.
Security issues are obviously more complex than one-line explanations. Thank you for your more elaborate reply!
Using POST is not sufficient; you also need to include an XSRF token that only the requesting page knows. It's very possible to send a POST to a third-party site with about one line of Javascript. (In the relatively early days of Reddit, I wrote a page that upvoted itself by having a JS handler in an invisible iframe resubmit the same link over again, using the visitor's login credentials. At the time, submitting the same link twice on Reddit counted as an upvote, and so merely visiting the page would upvote the link.)