Review 13.4 Abandoned

94464[BUGFIX] Handle the case where encryptionKey is not set

Benjamin Franzke CR +1 V +1 Easy +1 −1 updated 06/11/26, 05:52

Commit message

Avoid a warning in HashService when encryptionKey is
not yet set, which happens during initial TYPO3 installation.

Review

  • Code review CR +1
    • Oliver Klee +1
    • Oliver Hader +1
  • Verified V +1
    • Oliver Klee +1
    • Oliver Hader +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 1314

  1. Benjamin Franzke uploaded patch set 1 06/10/26, 11:42

  2. core-ci voted on patch set 1 V +1 06/10/26, 11:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103320

  3. Oliver Klee voted on patch set 1 CR +1 V +1 06/10/26, 12:01

  4. Oliver Hader voted on patch set 1 CR +1 V +1 06/10/26, 12:03

  5. Garvin Hicking commented on patch set 1 06/10/26, 12:04

    HashService.php:42

    To prevent some kind of encryption-key prefix readout, how about instead using a random fallback instead of empty string? Something like microtime or so?
  6. Garvin Hicking commented on patch set 1 06/10/26, 12:05

    HashService.php:42 Reply

    ... maybe we also need to spceifically catch the install tool context here; otherwise consumers of this when missing an encryption key (or something influences the encryption key) might generate unsafe values. So maybe still throw on "usual" cases for consumers, and just exclude install tool?
  7. Benjamin Franzke commented on patch set 1 06/10/26, 12:10

    HashService.php:42 Reply

    All non-install tool usages are covered by https://github.com/TYPO3/typo3/blob/806967fa211062ec3d15b48a0794d8520d9ccaf7/typo3/sysext/core/Classes/Core/Bootstrap.php#L152 One addtional "usecase" that I could think of are btw functional tests that use a cache without a mocked encryption key.
  8. Garvin Hicking commented on patch set 1 06/10/26, 12:26

    HashService.php:42 Reply

    That could also be circumvented by extensions or others manipulation the encryptionKey on the fly (intentionally or accidentally). I would argue HashService should also gate against runtime modification that makes this moot, and I would also argue functional tests should mock a fixed encryption key for explicitness...
  9. Benjamin Franzke commented on patch set 1 06/10/26, 14:23

    HashService.php:42 Reply

    Yes, I agree, for `main` we should be more strict and require respective tests to have a respective setup, but for the released versions I'd like to make this less "breaking": https://forge.typo3.org/issues/110031#note-8 > That could also be circumvented by extensions or others manipulation the encryptionKey on the fly (intentionally or accidentally). Maybe that's another topic? I mean that's something we can discuss for sure, but runtime manipulation by *extensions* is something we "never" handle, since an extension could basically manipulate everything. There isn't a sandbox or so…
  10. Helmut Hummel commented on patch set 1 06/10/26, 16:43

    HashService.php:42 Reply

    I think the security change was already a high impact change, pushed to released branches. Therefore I would choose an adequate change (identical to main) for those branches as well, like these issues would have been discovered beforehand. That said, I would rather propose to let the NullBackend implement the TransientBackendInterface, so that serialisation does not happen at all in VariableFrontend. This is a logical change, that can be safely applied to all branches and would also make this workaround obsolete: https://review.typo3.org/c/Packages/TYPO3.CMS/+/94463
  11. Garvin Hicking commented on patch set 1 06/10/26, 16:45

    HashService.php:42 Reply

    I am fine with covering more strictness in a followup for main, resolving this comment.
  12. Helmut Hummel commented on patch set 1 06/10/26, 17:32

    HashService.php:42

    I think the security change was already a high impact change, pushed to released branches. Therefore I would choose an adequate change (identical to main) for those branches as well, like these issues would have been discovered beforehand. That said, I would rather propose to let the NullBackend implement the TransientBackendInterface, so that serialisation does not happen at all in VariableFrontend. This is a logical change, that can be safely applied to all branches and would also make this workaround obsolete: https://review.typo3.org/c/Packages/TYPO3.CMS/+/94463
  13. Helmut Hummel commented on patch set 1 06/10/26, 18:57

    HashService.php:42 Reply Unresolved

  14. Benjamin Franzke abandoned the change 06/11/26, 05:52