Improve CSRF protection scheme to accommodate more web/mobile app scenarios #898
Labels
architecture
Related to the framework architecture
REST API
API standard
security
Framework security issue
up-for-grabs
Not assigned yet
Milestone
Right now CSRF protection is implemented solely by using a CSRF token associated with the client's PHP session. The client must retrieve the token from a web page, either from an embedded form element, or from the global Javascript
site
variable, and then send it to the server in the request body. The server then checks it against the token stored in the client's session.This can be a problem for two reasons:
One alternative, or supplemental method we could include, is simply checking for the
X-Requested-With: XMLHttpRequest
in the request for AJAX requests. See https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Protecting_REST_Services:_Use_of_Custom_Request_HeadersThe text was updated successfully, but these errors were encountered: