Issue Bug Resolved

#91697Access protecting root page results in "page not found" when user is not logged in, as opposed to "page inaccessible"

Claus Due 06/23/20, 13:01 updated 11/06/26, 22:10

Description

This is a rather complex bug. It triggers when:

  • You configure the root page of a domain to be access protected
  • TypoScriptFrontendController attempts to resolve the page, but does not disable access checks
  • An early guard clause triggers pageNotFound handling because page is not resolved – but root line is NOT empty
  • This prevents the true group access checks from triggering

The result is that any custom class registered for page-not-found handling is told the page does not exist, when it fact it does exist but is merely access protected. And this in turn prevents such a custom class from handling this particular case as an access failure case.

It is possible to work around this:

if (empty($parameters['pageAccessFailureReasons']) && count($controller->rootLine) === 1) {
    // No reason was provided and the root line contains a single entry. Check the only page that is in the
    // root line and determine if it was access protected. If it is access protected, return true.
    // Perform the access check by repeating a call to get the page record, but with access check enabled.
    $pageIsRootAndNotAccessibleByUserGroup = !$controller->checkPageGroupAccess($controller->rootLine[0]);
}

Suggested fix:

In \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getPageAndRootline, in the second check for “if (empty($this->page))”, check if:

  • Root line contains a single entry (the requested page was the root page and it exists)
  • $this->checkPageGroupAccess($this->rootline0) returns false

If fulfilled:

  • Set $this->pageNotFound = 1 indicating that failure reason is that page is not accssible
  • Set $this->pageAccessFailureHistory[‘direct_access’][] = $this->rootline0;
  • call $this->pageNotfoundAndExit(‘The requested page was not accessible!’, $GLOBALS[‘TYPO3_CONF_VARS’][‘FE’][‘pageUnavailable_handling_statheader’]); instead of calling $this->pageNotFoundAndExit(‘The requested page does not exist!’);

This causes the same check and failure reason for a request made directly to a protected root page, as would trigger for a request made directly to a protected sub-page.

Bug is encountered on 8.7 but almost certainly exists on all versions up to and after 10 LTS.

Set to “must have” as this bug is a serious inconsistency that prevents proper use of custom page-not-available handling.

Reviews 2

History 36

  1. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-11-06T21:35:10+00:00" > 11/06/26, 21:35 </span>

    Applied in changeset commit:97ac276c3da53ba544ce2fed3ac1a76e04268bf2.

  2. Gerrit Code Review pushed patch set 2 for 14.3 to change 97405 status Resolved Under Review <span data-processor="relativetime" data-value="2026-11-06T21:49:37+00:00" > 11/06/26, 21:49 </span>

  3. Benni Mack commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2026-11-06T22:10:11+00:00" > 11/06/26, 22:10 </span>

    Applied in changeset commit:18ecf399422761b3d60ba62a87eb307115653041.