June 6, 2021

Are anti-forgery tokens necessary when we have the Origin header?

I was reading [this](https://stackoverflow.com/a/42242802/2063755):

>browsers always send the Origin header in all POST, PUT, PATCH, and DELETE requests.

How much can we rely on this?

If it’s true that browsers send the Origin header for POST requests, then do we need to bother with anti-forgery tokens?

Or is it simply a matter of defence in depth?

Leave a Reply

Your email address will not be published. Required fields are marked *

Note: By filling this form and submitting your commen, you acknowledge, agree and comply with our terms of service. In addition you acknowledge that you are willingly sharing your email address with AiOWikis and you might receive notification emails from AiOWikis for comment notifications. AiOWiksi guarantees that your email address WILL NOT be used for advertisement or email marketting purposes.

This site uses Akismet to reduce spam. Learn how your comment data is processed.