I'm getting the following error returned intermittently from my several of my controllers:
"This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet."
But in the return statement I do set JsonRequestBehavior to AllowGet
return Json(new {Success = true, Plan = populatedPlan}, JsonRequestBehavior.AllowGet);
I found the following article which describes a vulnerability when returning JSON with GET Requests.
https://haacked.com/archive/2009/06/25/json-hijacking.aspx/
I checked my code and some of the controllers were returning just a single JS array so I fixed those to return an object with the array assigned to a propery on that object. However, not all my controllers are doing this, like the one in my code snippet - that returns a JS object - but the response is still occasionally blocked.
How can I stop this error from happening?
[Edit] This is happening about 1 in every 200 requests. I'm just confused as to why it's happening when I'm already doing what the error message is explicitly telling me to do.