Repository navigation
Keep a password changed during a login when upgrading its encoding - #302
Merged
Merged
Conversation
When a login re-encodes a password stored with an older encoding, the user is now read again first, and the re-encoded password is stored only if the stored password is still the one the login checked. A password changed in the meantime, for example by an administrator, is kept. PersistenceSessionFilter now comes first in web.xml, so it releases the persistence session for every request, including the ones Spring Security answers itself, such as logins.
mraible
force-pushed
the
recheck-stored-password
branch
from
November 17, 2026 05:15
e8e171e to
3ba1e7c
Compare
snoopdave
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A follow-up to #301, from a review of #300.
When a login re-encodes a password stored with an older encoding,
RollerUserDetailsService.updatePasswordnow releases the persistence session, reads the user again and stores the re-encoded password only if the stored password is still the one the login checked. If an administrator changed it in the meantime, that change is kept.PersistenceSessionFilternow comes first inweb.xml, so it releases the persistence session for every request, including the ones Spring Security answers itself, such as login posts. The filter doesn't read the request, so it can come ahead ofCharEncodingFilter.PasswordUpgradeTesthas a case where the password is reset after the login read the user; it fails without the change.FilterOrderTestchecks thatPersistenceSessionFilteris the first filter mapping.mvn testpasses (749 tests), and the Playwright database-login suite passes againstjetty:run(20 run, 3 OIDC tests skipped).lazyUpgradeFrom=SHA), master with and without this change behaved the same for logins, private-weblog access, comment preview and post, draft and published entry saves, profile saves, and a 1,741-address header sample, with no new errors in the log.No CHANGES entry: the password upgrade from #301 hasn't been released yet.