-
-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Requests cause CSRF overwrite #113
Comments
I experience the same issue, with the exception that it also happens when the application you load on Tab A and Tab B is the same. I think the biggest problem with the behavior is that you cannot 'fix' it by refreshing the browser tab, it needs to be closed completely. Once you have several applications running under the same auth host, it is a daunting task. Of course it is possible to increase the |
Good point, I've thought about this a little and my current thinking is to append a short random string to the CSRF cookie name, for example I'll need to do a little more reading to ensure this is viable. |
Sounds good to me. Let me know if you need any beta testing. :) |
Or a different idea is to send 401 to non-authorized non-html requests instead of redirecting to the login page. Like |
It seems the CSRF validation on a different tab is something that is easy to hit when running Home Assistant behind Traefik+Forward Auth (see here). It seems that Home Assistant single page app uses websockets, and on pressing "Retry" it seems to do something like you describe with multiple tabs. I get prompted to choose a Google account and then get the "Not authorized" error due to CSRF state mismatch
IIRC, having worked on OAuth2 flows before, the CSRF cookie id was the solution we went with as well. |
Now fixed in #187 & pegged for release in 2.3 |
As raised by @bekoeppel in #31 (comment) there is an issue whereby subsequent requests will cause CSRF cookies to be overwritten:
I'm opening this issue to track possible solutions, my initial thoughts are:
I will have a look to see what other approaches have been adopted elsewhere
The text was updated successfully, but these errors were encountered: