Review main Merged Breaking

82666[!!!][TASK] Deprecate and replace extbase HashService

Torben Hansen CR +2 V +2 Hard +366 −90 updated 01/28/24, 20:08

Commit message

This change deprecates the class
`TYPO3\CMS\Extbase\Security\Cryptography\HashService`.

Due to the deprecation, all usages of the class in TYPO3 core
have been replaced with the new class
`TYPO3\CMS\Core\Crypto\HashService`. The new HashService
incorporates an additional secret for hash generation to prevent
hash reuse across different contexts, enhancing the security of
generated hashes.

The change results in the following breaking changes.

Many of the code changes itself are not *strictly* breaking since
most of the affected code is marked @internal. In this special
case however, we decided to go with full blown deprecation
documentation files, though.

- Frontend user password recovery hashes generated with versions
prior to TYPO3 v13 are invalidated due to the replacement of the
HashService. Users with valid, non-expired recovery links will
need to request new ones.

- Custom extensions relying on
`TYPO3\CMS\Extbase\Security\Cryptography\HashService` for property
types or expecting its presence will encounter PHP Fatal errors.
This affects various `@internal` properties across the TYPO3 core
and extensions.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oliver Hader +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oliver Hader +1
    • core-ci +1 CI

Issues 1

Files 23

Show 3 more files

Review log 2135

Show 510 earlier messages
  1. Torben Hansen uploaded patch set 1 01/27/24, 06:48

  2. core-ci voted on patch set 1 V -1 01/27/24, 06:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52282

  3. Torben Hansen uploaded patch set 2 V -1 01/27/24, 11:30

  4. core-ci voted on patch set 2 V +1 01/27/24, 11:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52285

  5. Torben Hansen uploaded patch set 3 V +1 01/27/24, 13:47

  6. Torben Hansen uploaded patch set 4 01/27/24, 13:49

  7. core-ci voted on patch set 3 V -1 01/27/24, 13:53 Copied votes on follow-up patch sets have been updated: * Verified-1 has been copied to patch set 4 (copy condition: "changekind:NO_CHANGE"). Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52300

  8. core-ci voted on patch set 4 V -1 01/27/24, 13:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52301

  9. Torben Hansen uploaded patch set 5 V -1 01/27/24, 14:04

  10. core-ci voted on patch set 5 V +1 01/27/24, 14:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52302

  1. Torben Hansen uploaded patch set 6 V +1 01/27/24, 17:30

  2. core-ci voted on patch set 6 V +1 01/27/24, 17:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52307

  3. Garvin Hicking commented on patch set 6 01/27/24, 17:41

    some doc remarks, no code review

    Breaking-102763-ExtbaseHashServiceUsageReplacedWithCoreHashService.rst:16

    "replaced by"

    Breaking-102763-ExtbaseHashServiceUsageReplacedWithCoreHashService.rst:34

    "of the", copypasta

    Breaking-102763-FrontendUserPasswordRecoveryHashesInvalidated.rst:24

    + "These hashes have a limited lifetime already (12 hours). On large installations that require the hashes to survive a major update, you could write a small CLI task that re-adds missing hashes created in the maintenance time window of the upgrade." (may need rephrasing, just an idea to get people unannoyed.)

    Deprecation-102763-ExtbaseHashService.rst:15

    "in favor of" instead "favor to".
  4. Christian Kuhn commented on patch set 6 01/27/24, 18:33

    Breaking-102763-ExtbaseHashServiceUsageReplacedWithCoreHashService.rst:16 Reply

    Done

    Breaking-102763-ExtbaseHashServiceUsageReplacedWithCoreHashService.rst:34 Reply

    Done

    Breaking-102763-FrontendUserPasswordRecoveryHashesInvalidated.rst:24 Reply

    Done

    Deprecation-102763-ExtbaseHashService.rst:15 Reply

    Done
  5. Christian Kuhn uploaded patch set 7 V +1 01/27/24, 18:35

  6. core-ci voted on patch set 7 V +1 01/27/24, 18:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52313

  7. Oliver Hader commented on patch set 7 01/28/24, 17:07

    ActionController.php:586

    It feels like this should be more specific (containing an "extbase"-reference) and organized in a constant or enum...
  8. Oliver Hader uploaded patch set 8 V +1 01/28/24, 17:31

  9. core-ci voted on patch set 8 V -1 01/28/24, 17:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52373

  10. Oliver Hader uploaded patch set 9 V -1 01/28/24, 17:38

  11. core-ci voted on patch set 9 V -1 01/28/24, 17:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52374

  12. Oliver Hader uploaded patch set 10 V -1 01/28/24, 17:50

  13. core-ci voted on patch set 10 V -1 01/28/24, 17:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52375

  14. Oliver Hader uploaded patch set 11 V -1 01/28/24, 18:06

  15. core-ci voted on patch set 11 V -1 01/28/24, 18:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52379

  16. Oliver Hader uploaded patch set 12 V -1 01/28/24, 18:08

  17. core-ci voted on patch set 12 V -1 01/28/24, 18:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52380

  18. Oliver Hader uploaded patch set 13 V -1 01/28/24, 18:15

  19. Oliver Hader commented on patch set 13 01/28/24, 18:17

    I changed the existing `HashService` breaking now as well - basically enforcing a generic pepper for Extbase apps, still using the old service. Code-wise it's the same. But those HMACs now have a pepper (which was the initial goal of this whole refactoring) → thus, existing hashes won't work anymore and have to be regenerated (clear cache & reload the form).

    ActionController.php:586 Reply

    Done
  20. core-ci voted on patch set 13 V -1 01/28/24, 18:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52381

  21. Oliver Hader uploaded patch set 14 V -1 01/28/24, 18:33

  22. Oliver Hader voted on patch set 14 CR +1 V +1 01/28/24, 18:36

  23. core-ci voted on patch set 14 V +1 01/28/24, 18:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52382

  24. Benni Mack voted on patch set 14 CR +2 V +2 01/28/24, 20:08

  25. Benni Mack merged patch set 15 01/28/24, 20:08