-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Support hashing the hashed password using crc32c when putting the user in the session #59562
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
[Security] Support hashing the hashed password using crc32c when putting the user in the session #59562
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,9 +292,16 @@ | |
} | ||
|
||
if ($originalUser instanceof PasswordAuthenticatedUserInterface || $refreshedUser instanceof PasswordAuthenticatedUserInterface) { | ||
if (!$originalUser instanceof PasswordAuthenticatedUserInterface | ||
|| !$refreshedUser instanceof PasswordAuthenticatedUserInterface | ||
|| $refreshedUser->getPassword() !== ($originalUser->getPassword() ?? $refreshedUser->getPassword()) | ||
if (!$originalUser instanceof PasswordAuthenticatedUserInterface || !$refreshedUser instanceof PasswordAuthenticatedUserInterface) { | ||
return true; | ||
} | ||
|
||
$originalPassword = $originalUser->getPassword(); | ||
$refreshedPassword = $refreshedUser->getPassword(); | ||
|
||
if (null !== $originalPassword | ||
&& $refreshedPassword !== $originalPassword | ||
&& (8 !== \strlen($originalPassword) || hash('crc32c', $refreshedPassword ?? $originalPassword) !== $originalPassword) | ||
) { | ||
return true; | ||
} | ||
|
@@ -303,7 +310,7 @@ | |
return true; | ||
} | ||
|
||
if ($originalUser instanceof LegacyPasswordAuthenticatedUserInterface && $refreshedUser instanceof LegacyPasswordAuthenticatedUserInterface && $originalUser->getSalt() !== $refreshedUser->getSalt()) { | ||
if ($originalUser instanceof LegacyPasswordAuthenticatedUserInterface && $originalUser->getSalt() !== $refreshedUser->getSalt()) { | ||
Check failure on line 313 in src/Symfony/Component/Security/Http/Firewall/ContextListener.php
|
||
chalasr marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The psalm false-positive is reported vimeo/psalm#9956 |
||
return true; | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.