[SECURITY] Prevent XSS due to wrong PATH_INFO evaluation
As already started in #88304 (but only for NormalizedParams) and later reverted in #89312 (because of cgi-bin problems), PATH_INFO is no longer considered as a preferable SCRIPT_NAME alternative. All known server configurations set SCRIPT_NAME these days to a proper value when cgi.fix_pathinfo is set. The fallback to PATH_INFO has been introduced with the initial revision of TYPO3 and isn't needed at all nowadays, it's actually wrong, as a REQUEST_URI like /index.php/foo/bar would incorrectly be interpreted as $scriptName == "/foo/bar", which let's all calculations on $scriptName fail and even leads to XSS where values derived from $scriptName are printed without being escaped. Also any ORIG_SCRIPT_NAME evaluation is dropped, as this variable contains the SCRIPT_NAME that was set by the webserver configuration before PHP applied cgi.fix_pathinfo. Using ORIG_SCRIPT_NAME effectively meant bypassing PHP's pathinfo fix. It usually contains the cgi-wra...
Showing
- typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php 5 additions, 11 deletionstypo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
- typo3/sysext/core/Classes/Http/NormalizedParams.php 12 additions, 16 deletionstypo3/sysext/core/Classes/Http/NormalizedParams.php
- typo3/sysext/core/Classes/Utility/GeneralUtility.php 12 additions, 16 deletionstypo3/sysext/core/Classes/Utility/GeneralUtility.php
- typo3/sysext/core/Tests/Acceptance/Support/Extension/BackendCoreEnvironment.php 0 additions, 1 deletion...s/Acceptance/Support/Extension/BackendCoreEnvironment.php
- typo3/sysext/core/Tests/Unit/Http/NormalizedParamsTest.php 18 additions, 67 deletionstypo3/sysext/core/Tests/Unit/Http/NormalizedParamsTest.php
- typo3/sysext/core/Tests/Unit/Log/Processor/WebProcessorTest.php 1 addition, 2 deletions...sysext/core/Tests/Unit/Log/Processor/WebProcessorTest.php
- typo3/sysext/core/Tests/Unit/Resource/ResourceCompressorTest.php 1 addition, 1 deletion...ysext/core/Tests/Unit/Resource/ResourceCompressorTest.php
- typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php 0 additions, 2 deletions...ext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php
- typo3/sysext/felogin/Tests/Unit/Validation/RedirectUrlValidatorTest.php 1 addition, 1 deletion...elogin/Tests/Unit/Validation/RedirectUrlValidatorTest.php
- typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php 7 additions, 6 deletions...ntend/Classes/Controller/TypoScriptFrontendController.php
Please register or sign in to comment