4 ms·
I'm surprised that isn't blocked by cross-site scripting prevention or something along those lines. Shouldn't forcing logout require that you have the cookie th
by yjftsjthsd-h 7y ago
I'm surprised that isn't blocked by cross-site scripting prevention or something along those lines. Shouldn't forcing logout require that you have the cookie that proves that you're logged in in the first place?
- vortico 7y agoAny site that has a GET route to /logout that does not check the referrer is vulnerable to this iframe/img attack.
- yjftsjthsd-h 7y agoIt really shouldn't be GET anyways; that's asking for trouble.
- iwalton3 7y agoSome of the pages that are exploited do use POST though. If it accepts authorization through a cookie and doesn't require an XSRF token or JSON content type, it is probably vulnerable. But yes in general making actions happen in response to a GET request is generally a bad idea, since these are often cached and considered "safe" to retry.
- _jomo 7y agoPlease don't rely on the Referer being present (ever). It's an optional header to send in a request and you can configure your browser — at least Firefox — to not send it for privacy reasons. Logout (or anything else that triggers changes of any kind) shouldn't be a GET request.
- throwaway63839 7y agoNot true. Using samesite cookie attribute prevents CSRF through IMG tags. (On browsers that support samesite, i.e. most browsers.)
- hirsin 7y agoThis is tricky - it's up to the site basically. For single site websites (hacker news, let's say) then yeah - samesite should be enabled to prevent this. For a large IDP like Google, Facebook, Microsoft, etc, you start to want* logout via cross-site requests, but it needs to be protected against DoS attacks like the link provided. So you need some other proof that the requesting site has a session - a session ID, an ID token, a unique identifier for one of the users in session (this is the least bulletproof one). * well, standards wise at least. Google doesn't document a logout url anymore.