#111502Preview simulation replaces logged-in frontend user who is already member of the simulated group
Description
Problem
A backend preview link of an access restricted page carries ADMCMD_simUser, and while a backend user is logged in, the parameter is kept on every link generated in the frontend.
If a frontend user is logged in as well and is already member of the simulated group (directly or through a subgroup), the simulation still takes place: the frontend user ID is replaced by a fake one (PHP_INT_MAX), the usergroup field is overwritten, and the request is flagged as preview. The visitor sees the “Preview” notice and a page rendered for a fake user instead of the page as the real frontend user, e.g. personalized content or felogin show wrong data.
Steps to reproduce
- Create a page restricted to frontend group 1, render
{context:frontend.user:id}on it. - Log in to the backend, and log in to the frontend with a frontend user who is member of group 1.
- Open the page with
?ADMCMD_simUser=1, e.g. via the “View” button of the page module. - The “Preview” notice is shown, and the user ID renders as 9223372036854775807 instead of the uid of the logged-in frontend user.
Cause
TYPO3\CMS\Frontend\Middleware\PreviewSimulator::simulateUserGroup() applies the simulation whenever ADMCMD_simUser is set and does not check whether the current frontend user already has the group.
Related: #104081 shows the same notice for logged-in frontend users without ADMCMD_simUser, caused by the rootline check in the same middleware.
Reviews 3
History 27
-
Gerrit Code Review pushed patch set 2 for main to change 97265 status
NewUnder Review <span data-processor="relativetime" data-value="2026-11-18T22:28:58+00:00" > 11/18/26, 22:28 </span> -
Gerrit Code Review pushed patch set 3 for main to change 97265 <span data-processor="relativetime" data-value="2026-11-19T08:27:45+00:00" > 11/19/26, 08:27 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 97265 <span data-processor="relativetime" data-value="2026-11-19T09:04:10+00:00" > 11/19/26, 09:04 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 97834 <span data-processor="relativetime" data-value="2026-11-19T09:37:42+00:00" > 11/19/26, 09:37 </span>
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-11-19T09:40:10+00:00" > 11/19/26, 09:40 </span> -
Gerrit Code Review pushed patch set 2 for 14.3 to change 97834 status
ResolvedUnder Review <span data-processor="relativetime" data-value="2026-11-19T09:49:26+00:00" > 11/19/26, 09:49 </span> -
Benni Mack commented and changed status
Under ReviewResolved <span data-processor="relativetime" data-value="2026-11-19T10:30:14+00:00" > 11/19/26, 10:30 </span>Applied in changeset commit:ba5b22f5ea984ea5b6433ace6eb0cc89a7eaebbd.
Applied in changeset commit:358e1f7ce9fa41619fbb6588998e7b45bce5bd6d.