[BUGFIX:13.1] Prevent c:0 variant and content leakage on fe_group-restricted pages#4641
Open
dkd-kaehm wants to merge 1 commit into
Conversation
280d843 to
6f3b32b
Compare
fab9706 to
97c25e0
Compare
…ed 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.
- Documentation/Releases/solr-release-13-1.rst
- Added a Release 13.1.2 section with this fix as the first entry.
Partially ports: TYPO3-Solr#4559
Closes: TYPO3-Solr#4642
97c25e0 to
5729a78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two interrelated bugs in the page indexing flow that cause
access-protected pages to be indexed with incorrect Solr documents:
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.
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:
enablecolumns.fe_group). For protected pages, filter group 0
from accessGroups and ensure pageUserGroup is in the list.
same-group protected content (isolation bug)" expecting only c:1.
"protected page with protected content", "translation of
protected page with protected content"):
expectedAccessFieldValues '2:1/c:0' -> '2:1/c:1'.
include the second CONTENT object outside TYPO3SEARCH markers.
Partially ports: #4559
Closes: #4642