How to prevent CSRF in a RESTful application?

前端 未结 6 486
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-12 12:07

Cross Site Request Forgery (CSRF) is typically prevent with one of the following methods:

  • Check referer - RESTful but unreliable
  • insert token into for
6条回答
  •  北海茫月
    2020-12-12 12:21

    There are a few methods in the CSRF Prevention Cheat Sheet that can be used by restful service. The most RESTful stateless CSRF mitigation is using the Origin or HTTP referer to make sure the requests originate from a domain you trust.

提交回复
热议问题