4 ms·
You can't trust the referrer header for anything security related.
by laumars 12y ago
You can't trust the referrer header for anything security related.
- Yengas 12y agohttps://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Checking_The_Referer_Header https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(...
- laumars 12y agoYour citation does reitterate my point. I quote "However, checking the referer is considered to be a weaker from of CSRF protection." The referrer header can be subject to all sorts of subtle edge cases such as switching between secure and unsecure content (or is it the other way around, I can't recall off hand?) which many broswers will then refuse to send a referrer header. So while checking the referrer might work most of the time, it's really not robust enough to be considered trustworthy for anything security related.