Issue Bug Closed

#108892Sudo Mode AccessStorage does not handle incorrect UTF-8 characters

Oliver Hader 02/07/26, 08:39 updated 03/31/26, 08:10

Description

Imported from https://github.com/TYPO3/get.typo3.org/issues/500

> The non-utf8 character was then found in $_SERVER[“GEOIP_CITY”] (in our case ‘Düsseldorf’), where the umlaut was incorrectly encoded.
> $_SERVER is included in $items as part of the AccessClaim object.

Reviews 3

Files 1

History 58

  1. Julian Hofmann commented and changed attached duesseldorf.jpg <span data-processor="relativetime" data-value="2026-02-07T14:23:08+00:00" > 02/07/26, 14:23 </span>

    The other way round: AccessStorage has problems with non-UTF8 characters.

    maikusch wrote, the following change “fixes” the issue:

    before

    $this->getBackendUser()->setAndSaveSessionData($sessionKey, json_encode($items));

    after

    $this->getBackendUser()->setAndSaveSessionData($sessionKey, json_encode($items, JSON_INVALID_UTF8_IGNORE));

    So, if invalid UTF8 would be ignored here, it would be stored. (If the database accepts invalid UTF8)
    That means, valid UTF8 is already handled correctly and works.

  2. Oliver Hader changed subject Sudo Mode AccessStorage does not handle UTF-8 characters correctly Sudo Mode AccessStorage does not handle incorrect UTF-8 characters <span data-processor="relativetime" data-value="2026-02-09T17:46:00+00:00" > 02/09/26, 17:46 </span>

  3. Oliver Hader commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-02-10T07:45:13+00:00" > 02/10/26, 07:45 </span>

    Applied in changeset commit:1d0cf0f949bc92dccd037a155d934710b3de8bb2.