Issue Bug Under Review

#111649Anonymization of tokens in error logs misses the last 24 characters of 64-char tokens

Georg Ringer 11/28/26, 10:47 updated 11/28/26, 10:53

Description

The error and exception handlers replace tokens in the logged request URL with --AnonymizedToken--. The pattern in AbstractExceptionHandler::anonymizeToken() only matches exactly 40 hex characters:

/(?:(?<=[tT]oken=)|(?<=[tT]oken%3D))[0-9a-fA-F]{40}/

Since #106307 (HMAC with SHA3-256) the backend route token has 64 hex characters, so only the first 40 are replaced and the remaining 24 stay in the log:

/typo3/module/web/layout?token=--AnonymizedToken--abababababababababababab&id=1

How to reproduce

  1. Request a backend module URL with its token parameter in a way that makes the exception handler log the request URL (e.g. an exception in a backend module).
  2. Look at the request_url log context or the sys_log entry (“Requested URL”).
  3. The last 24 characters of the token are still visible.

Reviews 1

History 02

  1. Gerrit Code Review pushed patch set 1 for main to change 98151 status New Under Review 11/28/26, 10:52

  2. Gerrit Code Review pushed patch set 2 for main to change 98151 11/28/26, 10:53