Re:Why does Google append while(1); in front of their JSON r...
by blablabla123 on Tuesday February 05, 2013 @06:35AM
(#5170151)
I agree... I mean look at JSONP, that's basically the inverse hack. After all: what's the point of enforcing same-origin-policy in AJAX but ignoring it for <script>?
[ Parent
| on HN ]
Re:Why does Google append while(1); in front of their JSON r...
by mmahemoff on Tuesday February 05, 2013 @09:52AM
(#5170865)
The actual reason for this is web advertising took off like wildfire, using 3rd party scripts. It was too late to reverse by the time people got concerned about the security model.
Content Security Policy makes all this much more robust in modern browsers.
Re:Why does Google append while(1); in front of their JSON r...
by dspeyer on Tuesday February 05, 2013 @01:03PM
(#5172092)
JSONP lets the server turn off the same-origin policy. If XRFing your data is dangerous, don't use JSONP. But often we don't care about XRF, and the person writing the server is well-placed to know.