I have an existing rails website that makes json calls on the server. Now I am developing a mobile iOS app to use the same backend and send calls to json. However, mobile queries do not work with:
WARNING: Can't verify CSRF token authenticity
Search around stackoverflow, many have suggested disabling csrf checking for json calls using something like this:
# Or this in your application_controller.rb def verified_request? if request.content_type == "application/json" true else super() end end
But my question is: I do not understand how this prevents json csrf attacks? An attacker can always send a json request to our endpoint from his site. Does anyone know about this? I could not find a clear answer to this question.
Anish May 20 '12 at 18:28 2012-05-20 18:28
source share