Skip to content
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 not flushed when logging out #20100

Closed
errb opened this issue Jul 17, 2017 · 1 comment
Closed

Session not flushed when logging out #20100

errb opened this issue Jul 17, 2017 · 1 comment

Comments

@errb
Copy link

errb commented Jul 17, 2017

  • Laravel Version: 5.4.22
  • PHP Version: 7.0.9
  • Database Driver & Version: sqlite

Description:

If the application uses Laravel's authentication that comes out of the box and the user logs out, the session is not flushed. Instead, a new session is created alongside the old one.

I believe this part causes the issue:

$request->session()->flush();
$request->session()->regenerate();

When regenerate is called right after flush, the old session isn't actually flushed. This renders the regenerate part useless and poses a threat for session fixation exploit.

Steps To Reproduce:

  1. Using default Laravel Authentication, create a new user

  2. Once user is logged in, copy the session cookie value

  3. Log out

  4. Replace the session value with the one copied in step 2 (using Chrome Dev Tools or something similar)

  5. You are logged in again

@themsaid
Copy link
Member

Thanks for reporting, fixed in #20107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants