#111649Anonymization of tokens in error logs misses the last 24 characters of 64-char tokens
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
- Request a backend module URL with its
tokenparameter in a way that makes the exception handler log the request URL (e.g. an exception in a backend module). - Look at the
request_urllog context or thesys_logentry (“Requested URL”). - The last 24 characters of the token are still visible.
Reviews 1
History 02
-
Gerrit Code Review pushed patch set 1 for main to change 98151 status
NewUnder Review 11/28/26, 10:52 -
Gerrit Code Review pushed patch set 2 for main to change 98151 11/28/26, 10:53