ReferrerEnforcer

readonly class \TYPO3\CMS\Install\Http\Security\ReferrerEnforcer

Extends
ReferrerEnforcer

Treats a referrer as same-origin only if it addresses the install tool entry point (site path plus `__typo3_install` query parameter) - and not merely the same host.

Note this requires the client to submit the query string as part of the Referer header. Deployments that reduce the referrer to its origin only (Referrer-Policy: origin or strict-origin) therefore cannot use the install tool while the feature toggle security.backend.enforceReferrer is enabled.

Table of Contents

Constants

TYPE_REFERRER_CROSS_SITE  : int = 8
TYPE_REFERRER_EMPTY  : int = 1
TYPE_REFERRER_SAME_ORIGIN  : int = 4
TYPE_REFERRER_SAME_SITE  : int = 2

Methods

handle()  : ResponseInterface|null
resolveAbsoluteWebPath()  : string
resolveReferrerType()  : int
Determines whether the referrer is same-origin (= the very same application), same-site (= the same host, but a different application) or neither of both.
resolveRequestHost()  : string

Constants

TYPE_REFERRER_CROSS_SITE

protected int TYPE_REFERRER_CROSS_SITE = 8

TYPE_REFERRER_EMPTY

protected int TYPE_REFERRER_EMPTY = 1

TYPE_REFERRER_SAME_ORIGIN

protected int TYPE_REFERRER_SAME_ORIGIN = 4

TYPE_REFERRER_SAME_SITE

protected int TYPE_REFERRER_SAME_SITE = 2

Methods

handle()

public handle(ServerRequestInterface $request, array $options) : ResponseInterface|null

Parameters

$request : ServerRequestInterface
$options : array

Return values

ResponseInterface|null

resolveAbsoluteWebPath()

protected resolveAbsoluteWebPath(string $target, ServerRequestInterface $request) : string

Parameters

$target : string
$request : ServerRequestInterface

Return values

string

resolveReferrerType()

Determines whether the referrer is same-origin (= the very same application), same-site (= the same host, but a different application) or neither of both.

protected resolveReferrerType(ServerRequestInterface $request) : int

Implementations must not fall back to the request directory to detect same-origin: all applications are served from the same entry script, which would make any same-site referrer appear as same-origin.

Parameters

$request : ServerRequestInterface

Return values

int

resolveRequestHost()

protected resolveRequestHost(ServerRequestInterface $request) : string

Parameters

$request : ServerRequestInterface

Return values

string
On this page