Is an X-Requested-With header server check sufficient to protect against a CSRF for an ajax-driven application?

前端 未结 6 2190
庸人自扰
庸人自扰 2020-12-05 04:44

I\'m working on a completely ajax-driven application where all requests pass through what basically amounts to a main controller which, at its bare bones, looks something li

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 05:22

    No this can be easily bypassed , By making A Cross-domain-Flash request to the server that contains this header and the request with it's credentials , see this : https://www.geekboy.ninja/blog/exploiting-json-cross-site-request-forgery-csrf-using-flash/?unapproved=6685&moderation-hash=91554c30888cfb21580f6873e0569da0

    The best way to protect against CSRFs is to make Header or Parameter contains a secret key for each request ,

提交回复
热议问题