63385[FEATURE] Reset password for backend users
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Andreas Kienast +1
-
Verified V +2 Done
- Georg Ringer +2
- Andreas Kienast +1
- TYPO3com +1 CI
Issues 1
Files 32
- typo3/sysext/backend/Classes/Authentication/PasswordReset.php2new+492 −0
- typo3/sysext/backend/Classes/Command/ResetPasswordCommand.php4new+147 −0
- typo3/sysext/backend/Classes/Controller/LoginController.php+123 −9
- typo3/sysext/backend/Classes/LoginProvider/UsernamePasswordLoginProvider.php+3 −0
- typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php+4 −0
- typo3/sysext/backend/Configuration/Backend/Routes.php2+22 −0
- typo3/sysext/backend/Configuration/Services.yaml+4 −0
- typo3/sysext/backend/Resources/Private/Language/locallang.xlf+3 −0
- typo3/sysext/backend/Resources/Private/Language/locallang_reset_password.xlf1new+59 −0
- typo3/sysext/backend/Resources/Private/Layouts/Login.html+6 −0
- typo3/sysext/backend/Resources/Private/Templates/Email/PasswordReset/AmbiguousResetRequested.htmlnew+12 −0
- typo3/sysext/backend/Resources/Private/Templates/Email/PasswordReset/AmbiguousResetRequested.txtnew+13 −0
- typo3/sysext/backend/Resources/Private/Templates/Email/PasswordReset/ResetRequested.html1new+12 −0
- typo3/sysext/backend/Resources/Private/Templates/Email/PasswordReset/ResetRequested.txtnew+15 −0
- typo3/sysext/backend/Resources/Private/Templates/Login/ForgetPasswordForm.htmlnew+47 −0
- typo3/sysext/backend/Resources/Private/Templates/Login/ResetPasswordForm.htmlnew+53 −0
- typo3/sysext/backend/Resources/Private/Templates/UserPassLoginForm.html+11 −0
- typo3/sysext/backend/Tests/Functional/Authentication/Fixtures/be_users.xmlnew+86 −0
- typo3/sysext/backend/Tests/Functional/Authentication/Fixtures/be_users_only_admins.xmlnew+87 −0
- typo3/sysext/backend/Tests/Functional/Authentication/PasswordResetTest.phpnew+155 −0
Show 12 more files
- typo3/sysext/backend/ext_tables.sqlnew+6 −0
- typo3/sysext/beuser/Classes/Controller/BackendUserController.php+36 −0
- typo3/sysext/beuser/Classes/Domain/Model/BackendUser.php+13 −0
- typo3/sysext/beuser/Resources/Private/Language/locallang.xlf+21 −0
- typo3/sysext/beuser/Resources/Private/Partials/BackendUser/IndexListRow.html1+15 −0
- typo3/sysext/beuser/ext_tables.php+1 −1
- typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php+8 −0
- typo3/sysext/core/Classes/Core/Environment.php+19 −0
- typo3/sysext/core/Classes/SysLog/Action/Login.php+2 −0
- typo3/sysext/core/Configuration/DefaultConfiguration.php+2 −0
- typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml+6 −0
- typo3/sysext/core/Documentation/Changelog/master/Feature-89513-PasswordResetForBackendUsers.rstnew+83 −0
Review log 3450
Show 1725 earlier messages
-
Benni Mack uploaded patch set 1 02/22/20, 23:22
-
TYPO3com voted on patch set 1 V +1 02/22/20, 23:43 Completed build in 21m 40s on Sat, 22 Feb, 11:43 PM Test Summary: 71586 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-525
-
Helmut Hummel commented on patch set 1 02/23/20, 11:36
I like the general approach for its simplicity. Only the bare minimum is done to achieve what is needed. I have some remarks regarding the current implementation, which I added as inline code comments. Some general remarks: It might be useful to make it possible to disable this feature by configuration, because there are quite some szenarios, where the TYPO3 backend login isn't based on local passwords. In such cases (e.g. LDAP login), it will be confusing to be able to trigger a local password reset workflow, which basically does nothing. Emails are an inherently insecure medium to transport sensitive information. I would further decrease the time the token is valid (or at least make it configurable as well, defaulting to 15min or so) Knowing a valid email address of a backend user enables an attacker to send out an arbitrary amount of recovery mails. A rate limiting API (can't find the forge ticket for handling this) or at least a hook to enable (a custom) one could be helpful as well.PasswordReset.php:53I can't see where it is checked for a non empty email here.PasswordReset.php:164I can't see how this improves the security of the token (with the current implementation) over it just being a random string. In case I'm correct, I'd just make $randomString the token.PasswordReset.php:199Whether the token is expired or not is checked against a timestamp value sent as GET argument. Thus the token can never expire :)PasswordReset.php:208Edge case szenario: After the recovery link is generated, the same email address is added to another user. Possible ways to handle that szenario: * Count for user rows with given email hash here as well and fail if !== 1 * Change TCA to make email unique (validate for uniquness in data handler * Add the uid to the identityPasswordReset.php:216Any reason the signature of this method returns an int instead of the user array or null? The latter seems more logical to me -
Helmut Hummel commented on patch set 1 02/23/20, 11:37
> Password resets are only valid for 4 hours (non-configurable) Maybe max 4h, but could be configurable between 10min and 4h? -
Andreas Kienast commented on patch set 1 CR -1 02/23/20, 14:52
on it now -
Andreas Kienast commented on patch set 1 02/23/20, 15:24
PasswordReset.php:53ReplyAckPasswordReset.php:164Reply UnresolvedPerhaps some extra entropy, I guess. Arguably this may be used as $additionalSecret in GU::hmac().PasswordReset.php:199ReplyAckPasswordReset.php:208Reply UnresolvedI'd prefer the uid-based solution. Changing the TCA may be a breaking change at this point.PasswordReset.php:216Reply UnresolvedI agree at this point, I just wonder why we "double check the user" in resetPassword(). If there is no special reason, I'm fine with changing this method to return an ?array. -
Andreas Kienast uploaded patch set 2 02/23/20, 16:11
-
TYPO3com voted on patch set 2 V -1 02/23/20, 16:11 Completed build in 23s on Sun, 23 Feb, 04:11 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-572
-
Benni Mack uploaded patch set 3 02/24/20, 10:31
-
TYPO3com voted on patch set 3 V +1 02/24/20, 10:49 Completed build in 18m 09s on Mon, 24 Feb, 10:49 AM Test Summary: 71589 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-609
-
Benni Mack uploaded patch set 4 03/04/20, 07:14
-
TYPO3com voted on patch set 4 V +1 03/04/20, 07:28 Completed build in 14m 11s on Wed, 4 Mar, 07:28 AM Test Summary: 72117 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-962
-
Benni Mack uploaded patch set 5 03/06/20, 10:19
-
TYPO3com voted on patch set 5 V +1 03/06/20, 10:33 Completed build in 13m 27s on Fri, 6 Mar, 10:33 AM Test Summary: 72072 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1012
-
Benni Mack uploaded patch set 6 03/06/20, 12:58
-
TYPO3com voted on patch set 6 V -1 03/06/20, 13:09 Completed build in 10m 27s on Fri, 6 Mar, 01:09 PM Test Summary: 4 of 72580 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1023
-
Benni Mack uploaded patch set 7 03/06/20, 13:31
-
Benni Mack uploaded patch set 8 03/06/20, 13:35
-
TYPO3com voted on patch set 7 V -1 03/06/20, 13:43 Completed build in 11m 04s on Fri, 6 Mar, 01:43 PM Test Summary: 4 of 72580 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1028
-
Roland Golla commented on patch set 8 V -1 03/06/20, 13:46
Can not load backend path /typo3 error TYPO3 exception (1/1) #1476050190 TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException Unable to generate a URL for the named route "password_forget" because this route was not found. -
Benni Mack commented on patch set 8 03/06/20, 13:47
> Patch Set 8: Verified-1 > > Can not load backend path /typo3 > > error TYPO3 exception > (1/1) #1476050190 TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException > Unable to generate a URL for the named route "password_forget" because this route was not found. You need to flush the system caches, as we now have a new route. -
Andreas Kienast commented on patch set 8 V -1 03/06/20, 13:48
I get the following error after I set a new password: Argument 3 passed to TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate() must be of the type array or null, string given, called in /typo3/sysext/fluid/Classes/ViewHelpers/TranslateViewHelper.php on line 165 -
TYPO3com voted on patch set 8 V -1 03/06/20, 13:50 Completed build in 14m 14s on Fri, 6 Mar, 01:50 PM Test Summary: 4 of 72580 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1030
-
Andreas Kienast uploaded patch set 9 03/06/20, 14:23
-
Andreas Kienast uploaded patch set 10 03/06/20, 14:26
-
TYPO3com voted on patch set 9 V -1 03/06/20, 14:37 Completed build in 14m 26s on Fri, 6 Mar, 02:37 PM Test Summary: 1 of 71964 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1032
-
TYPO3com voted on patch set 10 V -1 03/06/20, 14:39 Completed build in 12m 58s on Fri, 6 Mar, 02:39 PM Test Summary: 2 of 72577 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1033
-
Andreas Kienast uploaded patch set 11 03/06/20, 14:43
-
Andreas Kienast commented on patch set 11 CR -1 03/06/20, 14:49
still on it -
TYPO3com voted on patch set 11 V -1 03/06/20, 14:55 Completed build in 12m 06s on Fri, 6 Mar, 02:55 PM Test Summary: 72093 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1035
-
Andreas Kienast commented on patch set 11 03/06/20, 15:01
ResetPasswordCommand.php:103UnresolvedThis fails if I use "foo.com/typo3" instead of "foo.com/typo3/"ResetPasswordCommand.php:141Unresolveddirname(Environment::getCurrentScript(), 4) -
Andreas Kienast uploaded patch set 12 03/06/20, 15:01
-
Andreas Kienast uploaded patch set 13 03/06/20, 15:07
-
TYPO3com voted on patch set 12 V -1 03/06/20, 15:11 Completed build in 10m 39s on Fri, 6 Mar, 03:11 PM Test Summary: 72093 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1036
-
TYPO3com voted on patch set 12 V +1 03/06/20, 15:13 Completed build in 23m 07s on Fri, 6 Mar, 03:13 PM Test Summary: 72093 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1036
-
TYPO3com voted on patch set 13 V +1 03/06/20, 15:19 Completed build in 11m 48s on Fri, 6 Mar, 03:19 PM Test Summary: 72091 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1037
-
Andreas Kienast commented on patch set 13 CR -1 03/06/20, 15:30
IndexListRow.html:80UnresolvedThis label doesn't exist -
Andreas Kienast uploaded patch set 14 03/06/20, 15:41
-
TYPO3com voted on patch set 14 V +1 03/06/20, 15:53 Completed build in 11m 04s on Fri, 6 Mar, 03:52 PM Test Summary: 72093 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1040
-
Andreas Kienast voted on patch set 14 V +1 CR +1 03/06/20, 16:02
-
Andreas Kienast rebased onto patch set 15 03/06/20, 16:30
-
Andreas Kienast commented on patch set 15 V +1 CR +1 03/06/20, 16:32
I just did a rebase due to new phpstan configs -
TYPO3com voted on patch set 15 V +1 03/06/20, 16:41 Completed build in 10m 57s on Fri, 6 Mar, 04:41 PM Test Summary: 72093 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1045
-
Georg Ringer commented on patch set 15 03/06/20, 19:24
PasswordReset.php:97should it also check if there is an email addr filled?ResetPasswordCommand.php:46can't we use the 1st site config domain which is not / as fallbackRoutes.php:46strange that this and next is not commented -
Benni Mack commented on patch set 15 03/06/20, 19:26
PasswordReset.php:97Reply UnresolvedgetPreparedQueryBuilder() does that alreadyResetPasswordCommand.php:46Reply UnresolvedTried that at the beginning, that proved to be _not_ working. Mainly because I had www.example.com/subpage/ as the first site, so the "guessing" just went south big time.Routes.php:46Reply Unresolved:D -
Georg Ringer voted on patch set 15 CR +1 03/06/20, 19:47
-
Georg Ringer commented on patch set 15 CR -1 03/06/20, 20:01
locallang_reset_password.xlf:13Unresolvedthis sounds very strangeResetRequested.html:3Unresolvedthis looks strange. gitlab sends such mails ------- Hello, Georg Ringer! Someone, hopefully you, has requested to reset the password for your GitLab account on xxxxxx. If you did not perform this request, you can safely ignore this email. Otherwise, click the link below to complete the process. -
Georg Ringer commented on patch set 15 V +1 CR +1 03/06/20, 20:08
I remove my -1 for text as this can be improved later on, works great for me. thx! -
Georg Ringer voted on patch set 15 V +2 CR +2 03/06/20, 20:40
-
Georg Ringer merged patch set 16 03/06/20, 20:45