| ▲ | hatefulheart 3 hours ago | |||||||
I’m confused, how does this prevent a CSRF attack? SameSite or not is inconsequential to the check a backend does for a CSRF token in the POST. | ||||||||
| ▲ | hn_throwaway_99 2 hours ago | parent | next [-] | |||||||
The only reason CSRF is even possible is because the browser sends (or, well, used to send) cookies for a particular request even if that request initiated from a different site. If the browser never did that (and most people would argue that's a design flaw from the get go) CSRF attacks wouldn't even be possible. The SameSite attribute makes it so that cookies will only be sent if the request that originated them is the same origin as the origin that originally wrote the cookie. | ||||||||
| ||||||||
| ▲ | tptacek 2 hours ago | parent | prev [-] | |||||||
No? The whole point of SameSite=(!none) is to prevent requests from unexpectedly carrying cookies, which is how CSRF attacks work. | ||||||||
| ||||||||