Why while(1); , for(;;); as the prefix of a REST Webservices response?

Posted: Wednesday, January 12, 2011 by Venkat Pola in Labels:
2

Most of the REST web services JSON response will be like

while(1);{"feedItem": "sdf","status": "sdfsdf","updateTime": "sdfsdf"}
for(;;);{"t":"continue"}
for(;;);["a","b","c"]

Just go through the HTTP calls made inside in Facebook, Google calender, Chatter ..etc then you can find such responses.

while(1); , for(;;); all these are infinite loops, this is ensure that some other websites cant hack other sites data. By using this we can prevent Cross domain AJAX requests made using script tags.

Enhanced by Zemanta

2 comments:

  1. Gajendra says:

    Nice information Venki.

  1. Venki says:

    Thanks Gajendra.. Nice to see your comment.