-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
SEC-2856: Make cookie theft detection in remember-me service configurable because it's seriously broken #3079
Comments
The security model is an implementation of http://jaspan.com/improved_persistent_login_cookie_best_practice , which is not suitable for a multi threaded environment. Since the web is almost always multi threaded, it is simply broken. |
So the issues is here for more than two years aready. Is there any new info on this? I would like to see at least |
For those that want to avoid false cookieTheftExceptions, but still want to use the persistent remember me feature (but without cookie theft detection), the fix is pretty simply:
to:
|
I think #2648 is a duplicate of this issue. |
Is there an update on this |
There's problem with this solution. If the token is somehow stolen, the stolen token is always working and not event gets invalidated over a password change. |
I guess a "slightly less broken" workaround would be to return a value that is somehow derived from the old value but in a way that an attacker cannot reconstruct reliably (taking some private-data into account as well - and it would even only have to return the same result for a very short amount of time.. a few seconds, a minute tops so an easy solution would be that the or am i missing something? (for initial generation - when old token doesn't exist) a cache probably isn't necessary? |
I agree this implementation of remember me token services is not compatible with real world. The whitepaper may need some changes. I did easy workaround: The result is parallel requests pass. If someone steal token he has 30 minutes to use session with remember me token, with this solution he has 30 minutes and 30 seconds to use it. After this limit is cookie theft detection active. The cache time is configurable. It does not solve all of the problems, but most of them. |
can you share your code? |
Jean-Pierre Bergamin (Migrated from SEC-2856) said:
After enabling remember-me authentication for our SSO portal, people were complaining about errors they got while logging in. Those errors turned out to be CookieTheftExceptions.
After investigating quite intensively how these exceptions occured, we found that there are so many regular usecases how this can happen that this feature can be considered as really broken.
h5. Usecase 1
h5. Usecase 2
The problem here is that the browser never got the response with the updated cookie back because the user closed the tab before.
h5. Usecase 3
What happens here is that Chrome already sends a request in the background while entering the URL. When hitting enter before the background request returned with a new cookie in its response, a second request with the same cookie is sent again - which leads to a CookieTheftException.
h5. Usecase 4
The problem here is that all webapps redirect to the SSO app and query it almost simultaneously which leads to the CookieTheftException.
As you can see, this CookieTheftException detection makes more harm than it tries to resolve. The PersistentTokenBasedRememberMeServices should have a way to disable the cookie theft detection on demand.
Currently we "disable" the cookie theft detection by always returning a constant token data like:
The PersistentTokenBasedRememberMeServices class should be configurable to have cookie theft detection turned on or off.
The text was updated successfully, but these errors were encountered: