Review main Merged

92758[BUGFIX] Handle invalid UTF-8 in sudo mode session data

Oliver Hader CR +2 V +2 Normal +75 −1 updated 02/10/26, 07:43

Commit message

ServerRequestInstruction captures $_SERVER parameters which
may contain Latin-1 encoded values (e.g. GEOIP_CITY with
\xFC for ü). When AccessStorage::commitItems() calls
json_encode() on such data, it returns false, silently
losing all stored claims and grants.

Add JSON_INVALID_UTF8_SUBSTITUTE flag so invalid UTF-8
bytes are replaced with U+FFFD instead of failing the
entire encode operation.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Oliver Klee +1
    • Garvin Hicking +1
    • Anja Leichsenring +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Oliver Klee +1
    • Garvin Hicking +1
    • Anja Leichsenring +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 78

  1. Oliver Hader uploaded patch set 1 02/09/26, 18:40

  2. core-ci voted on patch set 1 V +1 02/09/26, 18:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95483

  3. Anja Leichsenring voted on patch set 1 CR +1 V +1 02/09/26, 19:16

  4. Garvin Hicking commented on patch set 1 CR +1 V +1 02/09/26, 19:34

    I only used the test UTF8 strings. Don't really know what e.g. binary data might do but consider that an edgier case than this one.
  5. Oliver Hader commented on patch set 1 02/09/26, 23:45

    Reply

    According to https://datatracker.ietf.org/doc/html/rfc2616 (HTTP/1.1), headers where encoded as ISO-8859-1. Thus, the proper - but more complicated, and probably more flaky - approach would be to detect ISO-8859-1 and convert it to UTF-8 when header values would be used internally.
  6. Oliver Klee voted on patch set 1 CR +1 V +1 02/09/26, 23:52

  7. Oliver Hader voted on patch set 1 CR +2 V +2 02/10/26, 07:42

  8. Oliver Hader merged patch set 2 02/10/26, 07:43