Repository navigation
Conversation
Users who log in through LDAP or the servlet container have users.passwords.externalAuthValue stored in place of a Roller password. Roller's password encoder no longer matches that placeholder, so it isn't treated as a password anywhere the encoder checks one.
…unt is disabled RollerSession now keeps a SHA-256 digest of the user's stored password hash from when the session logged in. On each lookup it reloads the user and, if the user is gone, disabled, or has a different password hash, it invalidates the HTTP session, clears the Spring SecurityContext for the request, and continues with an empty session, so the browser has to log in again. The check runs before the session-cache check, which would otherwise rebuild the session from the existing login. It applies to form, remember-me and OpenID logins alike, since the session tracks the Roller user name rather than the principal. Profile.save and UserEdit.save (when an administrator edits their own account) refresh the digest of the session that made the change, so that session stays logged in. Both actions now receive the servlet request through ServletRequestAware, as Register already does. (cherry picked from commit 32d476c)
snoopdave
reviewed
Nov 18, 2026
…thout a sign-in change Profile.save and UserEdit.save generated a new random stored password for OpenID accounts on every save, so with the session check a profile-only edit ended the user's other sessions. They now generate one only when the account has no stored password or its OpenID URL changes. PasswordChangeSessionTest covers a profile edit and an administrator edit of an OpenID account with another session open, and switching an account to OpenID.
…match an empty one Registration, the profile page and the admin user editor now reject users.passwords.externalAuthValue, and the default <externalAuth>, as a new password with a validation message, since that value never matches at login. An account that already has it can be given a new password by an administrator. An empty configured value now falls back to <externalAuth> for what Roller stores, and the password encoder never matches an empty password or the default placeholder.
…s dropped When the container passivates a session, RollerSession removes itself from it, and the next request rebuilt it from the login with the user's current password, so the session survived a password change. The session now keeps the login's user name and password digest in a separate attribute that outlives the Roller session, and a rebuild for that user ends the session when the password differs. PasswordChangeSessionTest covers a passivated session after a password change and one without a change.
…n-placeholder-6.1.x
…password-change-6.1.x # Conflicts: # app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/UserEdit.java # app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Profile.java
Contributor
Author
|
A second review raised a few more points, now addressed in the latest commits:
|
…password-change-6.1.x
…ember-me Registering without a password outside db mode no longer throws a NullPointerException when the passwords are compared. The remember-me signature for LDAP users now takes its placeholder from ExternalLoginAwarePasswordEncoder.externalLoginMarker(), so an empty users.passwords.externalAuthValue means the default there as it does everywhere else. With the default configuration the value is unchanged, so existing remember-me cookies stay valid. The tests now restore WebloggerConfig properties even when user teardown fails or the original value was not set, and put back the password encoder that RollerContext shares.
A login is now recorded in its session when Spring Security accepts it, from the form login and single sign-on success handlers and from the remember-me services, instead of on the first request to the Roller UI. A login that had only visited weblog pages before the password changed no longer adopts the new password and survives, and logging in again in a browser that still had a stale session is no longer ended on its next request. A request that finds its session already invalidated by a parallel request is treated as logged out instead of failing with an IllegalStateException. Profile and user admin saves compare OpenID URLs without their trailing slash, so saving an unchanged profile no longer regenerates the stored password and ends the other sessions of the user.
…password-change-6.1.x
The login hooks that record the password digest are set up only in security.xml, so this test loads that file and checks that the form login filter, the single sign-on filter and remember-me all use them. It fails if the success handler or the remember-me services reference is removed.
snoopdave
reviewed
Nov 20, 2026
snoopdave
left a comment
Contributor
There was a problem hiding this comment.
Review of 9a82d5b57: The earlier OpenID edit and passivated-session concerns are resolved. The current code still leaves some recorded sessions active after an account change, and two applicable form fixes from #321 are missing.
Earlier comments: 2 of 2 resolved.
app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Register.java:388 — Important: OpenID registration still puts its generated password inProfileBean. If validation returns the form,Register.jsprenders that value in hidden fields. The twin keeps the generated value outside the form bean and applies it duringsave(); port that change and its validation-error test.
Accounts created before users.passwords.externalAuthValue changed still have the old marker stored, encoded or not, and the encoder only recognized the current marker and the default, so the old marker matched at login. The new users.passwords.externalAuthValue.previous setting lists earlier markers, which are refused at login and can't be chosen as passwords, the same as the current one. Empty entries are ignored so an empty password never counts as a marker.
A login that recorded its password but had no Roller session yet, because it had not opened a Roller page or its session was passivated, kept going after its account was disabled or removed, since the user lookup came back empty and the check was skipped. Such a session now ends when its recorded account no longer resolves to an enabled user.
…n-placeholder-6.1.x
…ing the session Requests of the same session share one security context. Clearing only the current request's holder left the login in place for a parallel request, which could then start a new session with the user attached. The test fails without the change.
…rker BCrypt gives some passwords other than a marker the same hash as the marker, so an exact comparison with the marker isn't enough to keep it from matching. After the delegate matches, the encoder now also checks whether the current, default or a previous marker matches the stored value, and refuses the password if one does. The marker list is read once per check.
…e login page A request whose session ended because its user's password or account changed went on with no user, so a page showed Access Denied and a form post failed the salt check with a server error. The salt filters now redirect it: a page request goes back to the same page, where Spring Security asks for a login if the page needs one, and a form post goes to the login page. Weblog pages forwarded through the filter still render for a visitor who is not logged in.
DelegatingPasswordEncoder throws for a stored value without an encoder prefix when no lazy-upgrade encoder is configured, and for a null value, so such an account ended the login with an exception instead of bad credentials. The encoder now answers false for them.
An account whose real password equals the current, default or a previous marker can't log in, and until now the log didn't say why. The encoder now logs an info line for that refusal, without the password, so an administrator can tell it from a wrong password and set a new one.
The list is comma-separated, so a marker that contains a comma can't be listed there. roller.properties now says so, along with the accounts that need an administrator to set a new password. Roller also logs a warning at startup when the configured marker contains a comma.
Between the commit of a new password and the update of the saving session, another request of the same session saw the new password and ended the session. The saving request now tells its session which password it is storing first, and the session takes that password on as soon as it is stored. The user's other sessions still end.
…coder ExternalLoginMarkerPasswordTest now checks that registration, the profile page and user administration refuse a marker listed in users.passwords.externalAuthValue.previous, and its tearDown restores the configuration in a finally block. The provider tests for previous markers also check the encoder directly, and the list test covers spaces around an entry.
…ver error A request whose session has no user, such as one whose session was just ended, made the permission check fail with a NullPointerException.
The log line said a password or account had changed even when the request was only following a session another request had ended, and it didn't say whose session it was.
…password-change-6.1.x # Conflicts: # app/src/main/java/org/apache/roller/weblogger/ui/core/filters/LoadSaltFilter.java
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.
The 6.1.x version of #321, including its later changes (passivated sessions, OpenID profile saves). Stacked on #306, so merge #306 first; until then this PR's diff includes its commits. Profile and UserEdit implement ServletRequestAware here, as Register does, and the session tracks the Roller user name, so OpenID logins are covered.
When a user's password changes, by their own profile save or an administrator's edit, or the user is disabled, their other logged-in sessions end on their next request to
/roller-ui. The session that made the change stays logged in.Profile.saveandUserEdit.save(when administrators edit themselves) callRollerSession.savingPasswordbefore saving andrefreshPasswordafter, so the acting session and its own parallel requests stay logged in.CommentDataServletanswers a request whose session has no user with 403 instead of a server error.This changes
security.xml: form login now usesformLoginSuccessHandler, and both it andmyAuthenticationSuccessHandler(OpenID) wrap the usual success handler inRollerLoginSuccessHandler, which records the login.RollerRememberMeServicesrecords remember-me logins the same way. Sites that run a customizedsecurity.xmlneed to add the two handlers. Without them, a login is first recorded when it opens a Roller UI page, so a password change before that doesn't end it.Tests:
PasswordChangeSessionTest(including OpenID, passivated sessions, a parallel request of a session that is ended, and the session's own request during a password save),SecurityXmlLoginWiringTest,LoadSaltFilterTest,ValidateSaltFilterTest,CommentDataServletTest,ExternalLoginPlaceholderTestandExternalLoginMarkerPasswordTestpass locally.CHANGES entries for the 6.1.8 fixes will come in one PR.
A further review pass added these fixes: