#110844Backend live search throws exception for users without page mounts
Description
Scenario and result
A non-admin backend user without any page mounts (for example a file-only or module-only editor, who has file mounts but no db_mountpoints) uses the
backend toolbar live search. The request fails with an uncaught exception:
The given page record is invalid. Missing uid. (1578950324)
Live search is therefore completely unusable for any backend user who has no page mounts.
Cause
The live search providers DatabaseRecordProvider and PageRecordProvider only add the pid IN (...) restriction when the resolved page-id list is not empty:
if ($this->pageIdList !== []) {
$queryBuilder->andWhere($queryBuilder->expr()->in('pid', ...));
}
getPageIdList() returns an empty array both for admins (intended: search everything) and for a non-admin with no page mounts — the two cases are not
distinguished. So such a non-admin hits the unrestricted branch, the query returns records from pages outside their scope, and getEditActionLink() then
calls calcPerms(readPageAccess($row['pid'], ...) ?: []); readPageAccess() returns false for an inaccessible page, the empty array reaches isInWebMount(), and the exception is thrown.
Why this matters beyond the crash
No data is exposed today, because the request aborts with the exception before any result is rendered. However, the query has already crossed the
page-permission boundary at the database level – the exception is the only thing preventing out-of-scope record titles from being returned. If the crash
were fixed on its own, this would become an information disclosure. The correct fix must therefore restrict the query, not just stop the exception.
Fix
Respect the scenario and limit the results: the unrestricted branch must be reserved for admins only. A non-admin whose page-id list is empty has access to
no pages and must receive no results, instead of an unrestricted query that crashes. Applies to both DatabaseRecordProvider and PageRecordProvider.
Additionally, PageRecordProvider::count() never set $this->pageIdList (only find() did), so the count path applied no page-id restriction at all – this
is made consistent with find().
Reviews 3
History 16
-
Gerrit Code Review pushed patch set 1 for main to change 96195 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-30T05:48:23+00:00" > 09/30/26, 05:48 </span> -
Gerrit Code Review pushed patch set 2 for main to change 96195 <span data-processor="relativetime" data-value="2026-10-10T08:35:31+00:00" > 10/10/26, 08:35 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 96195 <span data-processor="relativetime" data-value="2026-10-10T08:43:51+00:00" > 10/10/26, 08:43 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 96596 <span data-processor="relativetime" data-value="2026-10-10T10:57:06+00:00" > 10/10/26, 10:57 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 96597 <span data-processor="relativetime" data-value="2026-10-10T10:57:15+00:00" > 10/10/26, 10:57 </span>
-
Torben Hansen commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-10T11:00:10+00:00" > 10/10/26, 11:00 </span>
Applied in changeset commit:c8a7c74b1f5dae4da58c2ff36ed5f8b49333655e.