Project

General

Profile

Actions

Bug #91582

closed

Fetching an internal page as 404 content breaks browser output and CDNs

Added by Markus Klein almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Backend API
Target version:
-
Start date:
2020-06-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
hard
Is Regression:
Sprint Focus:

Description

Defining the error handling in the site configuration like this

errorHandling:
  - errorCode: '404'
    errorHandler: Page
    errorContentSource: 't3://page?uid=27'

causes a "connection failed" in Chromium based browsers. CDNs like Cloudflare even start repeating the request relatively fast (multiple times per second) ending in a 502 status code.

The problem drills down to the headers being received/sent when requesting the internal error page (27 above).
This request might deliver a "Transfer-Encoding: chunked" header.
Since the whole response of the sub-request is passed on as response to the initial request, also the headers from the sub-request are passed on.

This is may lead to problems, as the initial request may have another context than the internal sub-request.
In this case the "Transfer-Encoding" is not the same for the internal and the initial request. The actual webserver has to take care about settings this header correctly.

Fixing this issue, by removing this specific header from the sub-response, mitigates the problem and properly shows the 404 error page correctly, immediately and foremost without DoS-ing the server by the CDN.


Files

monitoring.jpg (103 KB) monitoring.jpg Relaxation of the server load after applying the patch Markus Klein, 2020-06-04 14:41

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #81644: GeneralUtility::getUrl() socket method doesn't support chunked Content-EncodingClosed2017-06-21

Actions
Related to TYPO3 Core - Task #90956: Deprecate alternative fetch methods for GeneralUtility::getUrl()ClosedBenni Mack2020-04-05

Actions
Actions

Also available in: Atom PDF