-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
session fixation #5373
Comments
I have the same problem!! Any solution? |
Please read #5348 and https://guides.rubyonrails.org/security.html#replay-attacks-for-cookiestore-sessions. There's basically no way to avoid this for a valid session / cookie that's just copied and reused somewhere else. Thanks. |
I was looking at how devise mitigates the attack and to my surprise.. it didn't. Actually, one way to prevent this family of attacks is to keep a timestamp in the session and verify that :confirmed_at (or adding another field in the db to reset sessions) is before the current session timestamp. This is actually a big deal to ignore scenarios like someone creating an account in advance with another user email, save the session. Then, the real user, at some point, confirms the account or resets the password or whatnot and, from that time, the malicious user could use the account at will. |
A solution I found while working on this: |
Pre-check
Environment
Current behavior
After i login, i copy the session id in the cookies. Open a new browser, and use the session id. it logged the user in.
Expected behavior
It supposed to not logged the user in using the same session id that i copied from a different browser.
The text was updated successfully, but these errors were encountered: