Skip to content

[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
TYPO3-Solr:release-13.1.xfrom
dkd-kaehm:ports/4559_Prevent_c_0_leakage_on-fe_group-restricted-pages
Open

[BUGFIX:13.1] Prevent c:0 variant and content leakage on fe_group-restricted pages#4641
dkd-kaehm wants to merge 1 commit into
TYPO3-Solr:release-13.1.xfrom
dkd-kaehm:ports/4559_Prevent_c_0_leakage_on-fe_group-restricted-pages

Conversation

@dkd-kaehm
Copy link
Copy Markdown
Collaborator

@dkd-kaehm dkd-kaehm commented May 8, 2026

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: #4559
Closes: #4642

@dkd-kaehm dkd-kaehm force-pushed the ports/4559_Prevent_c_0_leakage_on-fe_group-restricted-pages branch from 280d843 to 6f3b32b Compare May 8, 2026 06:26
@dkd-kaehm dkd-kaehm force-pushed the ports/4559_Prevent_c_0_leakage_on-fe_group-restricted-pages branch from fab9706 to 97c25e0 Compare May 8, 2026 07:19
…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
@dkd-kaehm dkd-kaehm force-pushed the ports/4559_Prevent_c_0_leakage_on-fe_group-restricted-pages branch from 97c25e0 to 5729a78 Compare May 8, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant