Issue Bug Resolved

#106768PageInformationFactory throws PageInformationCreationFailedException

Philipp Parzer 05/26/25, 12:14 updated 10/28/26, 10:00

Description

Prerequisite: sys_redirect from redirect.example.org to example.org
URL: redirect.example.org/?id=2500%2C%2C1007330%2C

throws PageInformationCreationFailedException in TYPO3\CMS\Frontend\Page\PageInformationFactory in line 516
id parameter is used although security.frontend.allowInsecureSiteResolutionByQueryParameters is not set
id parameter is used although keep_query_parameters in redirect was not set

Reviews 2

Files 1

History 610

  1. Oliver Hader commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2025-05-26T19:42:17+00:00" > 05/26/25, 19:42 </span>

    The reason at that code location is PageAccessFailureReasons::ACCESS_DENIED_HOST_PAGE_MISMATCH

    Can you please share the complete (redacted) redirection response (like in my example below)?

    curl -Ik 'https://ip14.anyhost.it/?id=82,,123,'
    
    HTTP/1.1 307 Temporary Redirect
    Date: Mon, 26 May 2025 19:41:34 GMT
    Server: Apache/2.4.63 (Unix) OpenSSL/3.5.0 mod_fcgid/2.3.9
    X-Powered-By: PHP/8.2.24
    X-Redirect-By: TYPO3 Redirect 3
    location: https://ip14.anyhost.at
    Content-Type: text/html; charset=UTF-8

    The security.frontend.allowInsecureSiteResolutionByQueryParameters feature currently only applies to site-resolving.

  2. Philipp Parzer commented <span data-processor="relativetime" data-value="2025-05-27T05:29:15+00:00" > 05/27/25, 05:29 </span>

    There is no redirection because the Exception is thrown:

    HTTP/2 500 
    server: nginx/1.27.4
    date: Tue, 27 May 2025 05:24:32 GMT
    content-type: text/html; charset=UTF-8
    x-powered-by: PHP/8.3.17
    x-xss-protection: 1; mode=block
    x-ua-compatible: IE=edge
    x-content-type-options: nosniff
    strict-transport-security: max-age=31536000

    what I’m trying to do is: move alls URLs from old.example.org/* to example.org/ via sys_redirect (and remove all params)
    temporary fix is, to redirect via htaccess

  3. Sybille Peters commented and changed attached stack_trace_query.txt <span data-processor="relativetime" data-value="2026-03-25T10:24:43+00:00" > 03/25/26, 10:24 </span>

    Personally, I would put a redirect as you described in the web server configuration.

    However, it probably shouldn’t throw an exception either.

    I can reproduce it with v13:

    1) I added a redirect:

    • source_host: t3coredev13x
    • source_path: /?id=2500
    • target: t3://page?uid=815 (is existing page)
    • respect_query_parameters: 1

    curl -IL “http://t3coredev13x/?id=2500”

    I get:

    curl -IL "http://t3coredev13x/?id=2500"
    HTTP/1.1 500 Internal Server Error
    Date: Wed, 25 Mar 2026 10:11:47 GMT
    Server: Apache/2.4.58 (Ubuntu)
    X-UA-Compatible: IE=edge
    X-Content-Type-Options: nosniff
    Connection: close
    Content-Type: text/html; charset=UTF-8

    If I deactivate the setting “Security: frontend allow insecure site resolution by query parameters” I still get this.

    If redirect is deactivated, I get 404 (which is correct since “/” does not resolve to an active page on my site).

    stack trace attached.

  4. Andreas Kießling commented <span data-processor="relativetime" data-value="2026-10-05T08:56:47+00:00" > 10/05/26, 08:56 </span>

    We can confirm this issue with TYPO3 13.4.35

    Our redirect configuration:

    source_host: old.example.org
    source_path: #/.*#
    is_regexp: 1
    target: t3://page?uid=2257
    respect_query_parameters: 0
    keep_query_parameters: 0

    The source host has no matching site configuration. The target page belongs to a configured site with root page ID 1.

    Results

    • https://old.example.org/foo/bar resolves the redirect target successfully
    • The same request with ?id=1 throws PageInformationCreationFailedException with code 1705397417.
    • Replacing the page target with an absolute URL resolves the target successfully, including when ?id=1 is present. The original query parameters are not added to the target URL.

    The redirect record is matched correctly. The exception occurs during target URL generation:

    PageInformationFactory::checkCrossDomainWithDirectId()
    PageInformationFactory::create()
    RedirectService::bootFrontendController()
    RedirectService::getUriFromCustomLinkDetails()
    RedirectService::getTargetUrl()

    Apparent cause

    RedirectService::resolveSite() determines the target page’s site, but this site is not assigned to the request passed to PageInformationFactory::create(). bootFrontendController() updates the routing attribute using the resolved site’s root page ID, while the request’s site attribute remains a NullSite with root page ID 0.

    Additionally, the original query parameters are retained during this initialization regardless of keep_query_parameters. Consequently, checkCrossDomainWithDirectId() detects id=1 and checks the page’s rootline against root page ID 0, causing the exception.

    The code in main did not change in that regard.

  5. Gerrit Code Review pushed patch set 1 for main to change 97052 status Needs Feedback Under Review <span data-processor="relativetime" data-value="2026-10-23T07:33:29+00:00" > 10/23/26, 07:33 </span>

  6. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-28T10:00:15+00:00" > 10/28/26, 10:00 </span>

    Applied in changeset commit:17afc97403c0d4747c0ea7002cde41cb772fce4f.