Review main Abandoned

94859[BUGFIX] Prevent infinite recursion for self-linking doktype=3 pages

Oliver Hader CR 0 V 0 Normal +100 −2 updated 07/23/26, 10:16

Commit message

A page of doktype "Link" whose link resolves to the current
page (e.g. link = '#') recursed indefinitely in
PageLinkBuilder::buildLink(), since "current" always resolves
to the page currently rendered for the request. This was directly
triggerable by visiting such a page's own frontend URL, since
ShortcutAndMountPointRedirect hits the same code path while
still holding the page-cache generation lock.

This change adds two guards mirroring PageRepository's existing
iteration-cap pattern: an immediate check rejecting a page that
links to itself, and a depth-limit backstop for any other
unforeseen cyclic chain. Also stop the middleware from
redirecting to an empty target URL when resolution fails.

Review

  • Code review CR 0
  • Verified V 0
    • core-ci +1 CI

Issues 1

Files 4

Review log 79

  1. Oliver Hader uploaded patch set 1 07/21/26, 13:40

  2. core-ci voted on patch set 1 V -1 07/21/26, 13:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105102

  3. Oliver Hader uploaded patch set 2 V -1 07/21/26, 13:51

  4. core-ci voted on patch set 2 V +1 07/21/26, 14:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105103

  5. Garvin Hicking commented on patch set 2 07/22/26, 07:46

    PageLinkBuilder.php:273

    Could we use the runtime cache to track this instead of a state-introducing property?
  6. Oliver Hader commented on patch set 2 CR -1 07/22/26, 08:38

    Recursion counter needs to be changed

    PageLinkBuilder.php:273 Reply

    Thx for the remark. I did not pay attention here... I'd rather drop the recursion counter then.
  7. Oliver Hader voted on patch set 2 CR 0 07/23/26, 10:15

  8. Oliver Hader commented on patch set 2 07/23/26, 10:16

    PageLinkBuilder.php:273 Reply

    Done
  9. Oliver Hader abandoned the change 07/23/26, 10:16

    → see https://review.typo3.org/c/Packages/TYPO3.CMS/+/94883 (I accidentally pushed and continued with a new change-id)