snoopdave commented on code in PR #301:
URL: https://github.com/apache/roller/pull/301#discussion_r4592746208
##########
app/src/main/java/org/apache/roller/weblogger/ui/core/security/RollerUserDetailsService.java:
##########
@@ -85,6 +86,38 @@ public UserDetails loadUserByUsername(String userName) {
}
+ /**
+ * Stores a password that Spring Security re-encoded after a successful
+ * login, so passwords stored with an older encoding (for example the one
+ * named by passwds.encryption.lazyUpgradeFrom) move to
+ * passwds.encryption.algorithm. Nothing is stored when
+ * passwds.encryption.enabled is false, because the re-encoding would then
+ * be plain text.
+ */
+ @Override
+ public UserDetails updatePassword(UserDetails user, String newPassword) {
+ if (!WebloggerConfig.getBooleanProperty("passwds.encryption.enabled"))
{
Review Comment:
🐞Claude Issue: **Important:** This guard covers
`passwds.encryption.enabled=false`, but not `passwds.encryption.enabled=true`
with `passwds.encryption.algorithm=noop`. `RollerPasswordEncoders` accepts that
combination ("just for testing"). There, a successful login re-encodes an old
SHA/MD5 hash, or a `{bcrypt}` one, as `{noop}<password>` and stores the plain
text. Suggest skipping the update unless `newPassword` uses a hashing encoder,
e.g. `if (newPassword == null || newPassword.startsWith("{noop}")) return
user;` (which also covers the disabled case), with a test for `algorithm=noop`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]