Commit 97c25e0
committed
[BUGFIX] Prevent c:0 variant and content leakage on fe_group-restricted pages
Fixes two interrelated bugs in the page indexing flow that cause
access-protected pages to be indexed with incorrect Solr documents:
- Bug 1 (PageIndexer::index): the findUserGroups indexer request
collects fe_group values from all content rendered for that
request, including global-template content (footer/nav) which
typically has fe_group=0. Group 0 then reaches accessGroups and
triggers an unwanted c:0 variant via indexPage, making the page
findable without the required access group. Group 0 is now
filtered out when the page has fe_group > 0, and the page's own
group is ensured to be present so restricted-but-eligible users
can still find the page.
- Bug 2 (FrontendGroupsModifier): the event listener faked
pageUserGroup into the frontend groups unconditionally. During
the c:0 indexer request this granted access to fe_group-restricted
content elements, leaking protected bodytext into the c:0 Solr
document. pageUserGroup is now only faked in when userGroup > 0;
the c:0 request runs with anonymous groups.
The new fixture mirrors the production scenario: a protected page
(fe_group=1) with a protected CE (fe_group=1) alongside a footer/nav
CE (pid=1, fe_group=0) rendered via a second CONTENT object outside
the TYPO3SEARCH markers — the same shape global template content has
in production. Three existing data-provider yields had been silently
encoding the bug as expected ('2:1/c:0' on a page with fe_group=1)
and are corrected to '2:1/c:1', the semantically correct access
variant.
Files:
- Classes/IndexQueue/PageIndexer.php
- In index(): read pageUserGroup from the page record (via
enablecolumns.fe_group). For protected pages, filter group 0
from accessGroups and ensure pageUserGroup is in the list.
- Classes/EventListener/PageIndexer/FrontendGroupsModifier.php
- Add a userGroup > 0 guard to the pageUserGroup faking block.
- Tests/Integration/IndexQueue/PageIndexerTest.php
- Added data-provider yield "protected page: c:0 must not contain
same-group protected content (isolation bug)" expecting only c:1.
- Corrected three protected-page yields ("protected page",
"protected page with protected content", "translation of
protected page with protected content"):
expectedAccessFieldValues '2:1/c:0' -> '2:1/c:1'.
- Tests/Integration/IndexQueue/Fixtures/can_index_protected_page_with_public_and_same_group_protected_content.csv
- New fixture; sys_template inlined to render bodytext and
include the second CONTENT object outside TYPO3SEARCH markers.
Partially ports: #4559
Closes: #46421 parent 50674c9 commit 97c25e0
4 files changed
Lines changed: 89 additions & 5 deletions
File tree
- Classes
- EventListener/PageIndexer
- IndexQueue
- Tests/Integration/IndexQueue
- Fixtures
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
72 | 87 | | |
73 | 88 | | |
74 | 89 | | |
| |||
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
235 | 249 | | |
236 | 250 | | |
237 | 251 | | |
| |||
0 commit comments