Review main Merged Breaking

57759[!!!][TASK] Merge salted passwords auth service into default service

Christian Kuhn CR +2 V +2 Hard +453 −68 updated 08/08/18, 08:57

Commit message

The patch merges the default 'authUserBE' and 'authUserFE' authentication
service of extension saltedpasswords on priority 70 into the default
authentication service of the core on priority 50.

The now unused SaltedPasswordService is deprecated with this class.
Last inactive ways for authentication against stored plain text
passwords are removed.

While this is in almost all cases not a problem for existing instances
when upgrading, an edge case when this may lead to a security relevant
breaking change is described in a changelog file.

The new 'authUser' of the default core authentication method is
rewritten and carefully crafted to be much easier to understand, much
more defensive, better documented and tested.

Review

  • Code review CR +2
    • Christian Kuhn +2
    • Markus Klein +1
    • Anja Leichsenring +1
    • Jigal van Hemert +1
  • Verified V +2
    • Christian Kuhn +2
    • Markus Klein +1
    • Anja Leichsenring +1
    • Jigal van Hemert +1
    • TYPO3com +1 CI

Issues 1

Files 10

Review log 3548

Show 1723 earlier messages
  1. Christian Kuhn uploaded patch set 1 08/01/18, 17:06

  2. TYPO3com voted on patch set 1 V -1 08/01/18, 17:07 Completed build in 13s on Wed, 1 Aug, 07:07 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-25970

  3. Markus Klein commented on patch set 1 08/01/18, 18:50

    AuthenticationService.php:171

    please keep the third parameter, the information array, with the call. I added it back then, because it brings useful information when analyzing failed logins.

    AuthenticationService.php:183

    are we sure about this case. we have a salted pwd, but it does not match. Maybe there is a secondary SSO that is behind this one which uses also a PHP based salting, which can handle that? use case: Let TYPO3-local users take precedence over users from SSO.

    AuthenticationService.php:352

    typehints?

    AuthenticationService.php:370

    this is not quite true anymore
  4. Markus Klein commented on patch set 1 CR -1 08/01/18, 19:01

    AuthenticationService.php:124

    we have a very sophisticated check here in the SaltedPasswordSErvice $validPasswd && get_class($this->objInstanceSaltedPW) !== $defaultHashingClassName && !is_subclass_of($this->objInstanceSaltedPW, $defaultHashingClassName) I guess it had a reason?

    AuthenticationService.php:148

    is this a bug he have in the current code?? checkPassword expects the plain text pwd here

    AuthenticationService.php:155

    !strcasecmp
  5. Christian Kuhn commented on patch set 1 08/01/18, 19:11

    AuthenticationService.php:124 Reply

    no. current solution is much better. i tested this locally with class inheritence. should do well and is much easier than before.

    AuthenticationService.php:148 Reply

    no. that's ok. M says that the password is a salted hash of an md5.

    AuthenticationService.php:155 Reply

    good catch! i'll add unit tests to this part anyway and will re-check that.

    AuthenticationService.php:171 Reply

    will check.

    AuthenticationService.php:183 Reply

    no. this has also been a sec issue in 4.3 back then. it's important to keep that apart if salted passwords says 'i'm responsible, but password is wrong'. see http://forge.typo3.org/issues/22030

    AuthenticationService.php:352 Reply

    yes. will do .

    AuthenticationService.php:370 Reply

    will update.
  6. Markus Klein commented on patch set 1 08/01/18, 19:16

    AuthenticationService.php:183 Reply

    Yes. But this was only due to the fallback to the plain text thing, which is gone now!
  7. Christian Kuhn commented on patch set 1 08/01/18, 19:19

    AuthenticationService.php:183 Reply

    does not matter. still, we want that if this service saw that the password is a salted password (it got an instance), but that the submitted password did NOT match, that then all auth services below MUST fail. It does not matter that in 'sane' configs this auth service is the last one.
  8. Christian Kuhn commented on patch set 1 08/01/18, 19:21

    AuthenticationService.php:183 Reply

    i'd say this is an additional fall back for possible broken services or service configuration. better safe than sorry. never allow login if a password is a hash!
  9. Christian Kuhn commented on patch set 1 08/01/18, 21:23

    AuthenticationService.php:155 Reply

    Done

    AuthenticationService.php:171 Reply

    i don't get it. the info() call gets only one argument, others are just sprintf arguments which have to be reduced by one since there are only 2 %s in the message. see the notes by stefan on the initial issue georg introduced with https://review.typo3.org/#/c/57313/9/typo3/sysext/saltedpasswords/Classes/SaltedPasswordService.php which i'm fixing here along the way. did i get you wrong?

    AuthenticationService.php:352 Reply

    Done

    AuthenticationService.php:370 Reply

    Done
  10. Christian Kuhn uploaded patch set 2 08/01/18, 21:24

  11. TYPO3com voted on patch set 2 V +1 08/01/18, 21:31 Completed build in 06m 43s on Wed, 1 Aug, 11:31 PM Test Summary: 33647 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-25994

  12. Markus Klein commented on patch set 2 08/01/18, 22:06

    ah, you changed the ->info() calls to use the message. all good now. my mistake, sry.
  13. Christian Kuhn uploaded patch set 3 08/01/18, 22:08

  14. TYPO3com voted on patch set 3 V -1 08/01/18, 22:08 Completed build in 09s on Thu, 2 Aug, 12:08 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-25998

  15. Christian Kuhn uploaded patch set 4 08/01/18, 22:09

  16. Markus Klein commented on patch set 4 08/01/18, 22:13

    AbstractService.php:159

    should be serviceType, right?
  17. TYPO3com voted on patch set 4 V +1 08/01/18, 22:15 Completed build in 06m 21s on Thu, 2 Aug, 12:15 AM Test Summary: 33650 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-25999

  18. Christian Kuhn uploaded patch set 5 08/01/18, 22:17

  19. Christian Kuhn commented on patch set 4 08/01/18, 22:17

    AbstractService.php:159 Reply

    yeah. just fixed. what a mess.
  20. TYPO3com voted on patch set 5 V +1 08/01/18, 22:24 Completed build in 07m 22s on Thu, 2 Aug, 12:24 AM Test Summary: 33650 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-26000

  21. Christian Kuhn uploaded patch set 6 08/05/18, 20:08

  22. TYPO3com voted on patch set 6 V +1 08/05/18, 20:15 Completed build in 06m 25s on Sun, 5 Aug, 10:15 PM Test Summary: 33696 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-26211

  23. Christian Kuhn uploaded patch set 7 08/05/18, 20:15

  1. TYPO3com voted on patch set 7 V +1 08/05/18, 20:21 Completed build in 06m 18s on Sun, 5 Aug, 10:21 PM Test Summary: 33696 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-26212

  2. Christian Kuhn uploaded patch set 8 08/05/18, 20:25

  3. TYPO3com voted on patch set 8 V +1 08/05/18, 20:32 Completed build in 06m 51s on Sun, 5 Aug, 10:32 PM Test Summary: 33696 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-26213

  4. Christian Kuhn uploaded patch set 9 08/05/18, 21:24

  5. Christian Kuhn updated the commit message in patch set 10 08/05/18, 21:25

  6. Christian Kuhn uploaded patch set 11 08/05/18, 21:30

  7. TYPO3com voted on patch set 9 V +1 08/05/18, 21:31 Completed build in 07m 23s on Sun, 5 Aug, 11:31 PM Test Summary: 33696 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-26214

  8. Wouter Wolters commented on patch set 11 08/05/18, 21:32

    AuthenticationService.php:357

    first parameter missing here
  9. TYPO3com voted on patch set 10 V +1 08/05/18, 21:33 Completed build in 07m 58s on Sun, 5 Aug, 11:33 PM Test Summary: 33696 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-26215

  10. Christian Kuhn uploaded patch set 12 08/05/18, 21:35

  11. Christian Kuhn commented on patch set 11 08/05/18, 21:35

    AuthenticationService.php:357 Reply

    Done
  12. TYPO3com voted on patch set 11 V +1 08/05/18, 21:37 Completed build in 06m 54s on Sun, 5 Aug, 11:37 PM Test Summary: 33696 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-26216

  13. TYPO3com voted on patch set 12 V +1 08/05/18, 21:41 Completed build in 06m 37s on Sun, 5 Aug, 11:41 PM Test Summary: 33696 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-26217

  14. Markus Klein commented on patch set 12 08/06/18, 10:17

    an

    AuthenticationServiceTest.php:166

    a
  15. Markus Klein commented on patch set 13 08/06/18, 10:17

    Published edit on patch set 12.
  16. Markus Klein voted on patch set 13 CR +1 08/06/18, 10:18

  17. TYPO3com voted on patch set 13 V +1 08/06/18, 10:25 Completed build in 07m 20s on Mon, 6 Aug, 12:25 PM Test Summary: 33696 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-26221

  18. Markus Klein voted on patch set 13 V +1 08/07/18, 09:00

  19. Anja Leichsenring voted on patch set 13 V +1 CR +1 08/07/18, 09:20

  20. Christian Kuhn voted on patch set 13 V +2 CR +2 08/07/18, 11:07

  21. Christian Kuhn merged patch set 14 08/07/18, 11:07

  22. Jigal van Hemert commented on patch set 14 V +1 CR +1 08/07/18, 14:57

    Great improvement of the auth service! The logic is now understandable without have to read the code multiple times. Thank you for this patch.
  23. Markus Klein commented on patch set 14 08/07/18, 21:09

    AuthenticationService.php:112

    Mistake here: must be HTTP_HOST!
  24. Markus Klein commented on patch set 14 08/07/18, 21:35

  25. Christian Kuhn commented on patch set 14 08/08/18, 08:57

    AuthenticationService.php:112 Reply

    confirmed. mixed this up with the logging mess and couldn't unit test due to static salted password factory (this will be my next patch).