-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Avoid failing when PersistentRememberMeHandler handles a malformed cookie #60379
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
Conversation
Can we cover this case with a test? |
Added a test yes. I think looking a bit more at what happens the flow is like this:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one minor CS fix, thanks for the patch and the explanation.
$rememberMeDetails = RememberMeDetails::fromRawCookie($cookie); | ||
try { | ||
$rememberMeDetails = RememberMeDetails::fromRawCookie($cookie); | ||
} catch (AuthenticationException $e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} catch (AuthenticationException $e) { | |
} catch (AuthenticationException) { |
Thank you @Seldaek. |
If the remember me cookie is malformed like
"foo"
then the page crashes due to https://github.com/symfony/symfony/blob/7.3/src/Symfony/Component/Security/Http/RememberMe/RememberMeDetails.php#L39Not a huge deal but not very elegant