93047[TASK] Use HKDF for JWT key derivation
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Hannes Lau +1
- Andreas Kienast +1
- Oliver Hader +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Andreas Kienast +1
- Oliver Hader +1
- core-ci +1 CI
Issues 1
Files 4
Review log 1417
-
Benjamin Franzke uploaded patch set 1 03/03/26, 19:33
-
core-ci voted on patch set 1 V +1 03/03/26, 19:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97218
-
Benjamin Franzke wrote 03/04/26, 08:57
Hashtag added: actions -
Hannes Lau voted on patch set 1 CR +1 03/30/26, 19:30
-
Josef Glatz commented on patch set 1 CR -1 03/31/26, 04:02
Why not using `hash_hkdf` with salt as stated in the official docs https://www.php.net/manual/en/function.hash-hkdf.php ? I'm not a security expert, so please take my comments with a grain of salt 😉 -
Benjamin Franzke commented on patch set 1 03/31/26, 06:04
Reply
Because `salt` is meant to be random, and we have no *random* salt, which is why I decided to use the `$info` parameter (which is basically the subkey identifier instead), since I wanted to avoid adding non-random data to a parameter that is meant for random data. (because if something is supposed to be random and is not, that's a false "sense" of security) Of course I'd love to add some random salt, but that would need to be a permanently known one, and we don't have that. But this is for sure discussable, we'll see, thanks for you comment, it's good to talk this through :) -
Oliver Hader uploaded patch set 2
CR +1V +103/31/26, 11:23 -
Oliver Hader commented on patch set 2 CR +1 V +1 03/31/26, 11:34
Reply
Salt is an optional non-secret value (see https://datatracker.ietf.org/doc/html/rfc5869#section-2.2). If we would use that, it needs to be bundled to the JWT as well (somehow™). Thus, it's fine to omit it. Using HKDF is better than expanding the key by pure SHA256, since HKDF takes are of internal padding, separated secret and context and used HMAC internally). (HS256 in JWT internally uses HMAC as well on the provided key material - thus, the previous version was not insecure, but using HKDF for deriving secrets is definitively the better choice) -
Josef Glatz commented on patch set 2 03/31/26, 11:39
Reply
Acknowledged -
core-ci voted on patch set 2 V -1 03/31/26, 11:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99253
-
Benjamin Franzke uploaded patch set 3
CR +1V +103/31/26, 16:40 -
core-ci voted on patch set 3 V +1 03/31/26, 16:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99297
-
Oliver Hader voted on patch set 3 CR +1 V +1 03/31/26, 16:58
-
Hannes Lau voted on patch set 3 CR +1 04/01/26, 09:18
-
Andreas Kienast voted on patch set 3 CR +1 V +1 04/01/26, 12:26
-
Benjamin Franzke voted on patch set 3 CR +2 V +2 04/01/26, 12:26
-
Benjamin Franzke merged patch set 4 04/01/26, 12:26