Firebug v2 and ChromeTools know how to parse such JSON and ignore that first part. (IE11 and Firefox newer DevTools can't "handle" it aka show just a plain text string)
Why does Google prepend while(1); to their JSON responses?
11–20 of 120 posts
Re: Why does Google prepend while(1); to their JSON responses?
#12Re: Why does Google prepend while(1); to their JSON responses?
#13Around 90 something percent of websites I visit don't implement that `for(;;)` or `while(1)` solution.
So are we saying that they're vulnerable sites?
Re: Why does Google prepend while(1); to their JSON responses?
#14FB prepends a "for(;;);" which is 1 char shorter than "while(1);", has been the case since 2012/13. Firebug v2 and ChromeTools know how to parse such JSON and ignore that first part. (IE11 and Firefox newer DevTools can't "handle" it aka show just a plain text string)
Re: Why does Google prepend while(1); to their JSON responses?
#15Why don't browsers strip cookies when they are doing cross domain javascript fetches?
Re: Why does Google prepend while(1); to their JSON responses?
#16I wondered the same thing years ago. I always thought that browsers would have implemented other security measures so that websites avoid doing this. Around 90 something percent of websites I visit don't implement that `for(;;)` or `while(1)` solution. So are we saying that they're vulnerable sites?
Re: Why does Google prepend while(1); to their JSON responses?
#17I wondered the same thing years ago. I always thought that browsers would have implemented other security measures so that websites avoid doing this. Around 90 something percent of websites I visit don't implement that `for(;;)` or `while(1)` solution. So are we saying that they're vulnerable sites?
Re: Why does Google prepend while(1); to their JSON responses?
#18Why don't browsers strip cookies when they are doing cross domain javascript fetches?
Because that's the way internet works and breaking it means breaking a lot of websites. Web security wasn't thought carefully when web was built, it's just a bunch of dirty hacks around most obvious vulnerabilities.
Define httpsb:// do be like https://, but any site may make ajax and similar requests to it (without credentials). Then make some kind of exception (like csrf protection), or use legacy https, in case you need to send cookies.
Re: Why does Google prepend while(1); to their JSON responses?
#19I wondered the same thing years ago. I always thought that browsers would have implemented other security measures so that websites avoid doing this. Around 90 something percent of websites I visit don't implement that `for(;;)` or `while(1)` solution. So are we saying that they're vulnerable sites?
We are saying that they're vulnerable for THAT particular issue (the JSON hijacking), and that is only if they don't already have some other way of dealing with it.
Re: Why does Google prepend while(1); to their JSON responses?
#20FB prepends a "for(;;);" which is 1 char shorter than "while(1);", has been the case since 2012/13. Firebug v2 and ChromeTools know how to parse such JSON and ignore that first part. (IE11 and Firefox newer DevTools can't "handle" it aka show just a plain text string)
Why does it have to be a loop, couldn't you make a reliable syntax error in less than 8 characters?