News for hackers. Stuff that matters.
Re:JSON is not as safe as people think it is by zwily on Wednesday March 27, 2013 @10:57AM (#5449743)
This is why Google, Facebook, and others prepend JSON responses with while(1){}. Any browser trying to eval it will get stuck in an infinite loop, protecting the payload. That's what they did a couple years ago at least. It looks like gmail is now prepending with )]}' for some JSON calls instead.
Re:JSON is not as safe as people think it is by Zarel on Wednesday March 27, 2013 @12:51PM (#5450497)
I've been prepending with ], which as far as I know is enough to make any JSON data into a syntax error... is there a reason why these companies use longer things?
Re:JSON is not as safe as people think it is by zwily on Wednesday March 27, 2013 @02:50PM (#5451262)
I don't know. It looks like they're prepending some responses with )]}' now, which would cause a syntax error as well.