So I was looking through the Mootools docs for Request and noticed a somewhat recent comment posted that reads the following...
"Be aware of XSS vulnerability: Default value for secure is falsy, which means that JSON.decode("alert(document.cookie)") shows a popup !"
The documentation for the JSON.decode method says this:
JSON Method:Decode
Converts a JSON string into a JavaScript object.
Syntax:
var object = JSON.decode(string[, secure]);
Arguments:
string - (string) The string to evaluate.
secure - (boolean, optional: defaults to false) If set to true, checks for any hazardous syntax and returns null if any found.
Returns: (object) The object represented by the JSON string.
So, based on the documentation, it's pretty obvious to me that the JSON.decode method is set to be "insecure" by default. My question though is what (if anything) that has to do with XSS, and whether that comment from the top of my post is valuable. Assuming you're using Mootools in the frontend, and you trust the address you're making your AJAX call to, how could this be a XSS security exploit?