84824[FEATURE] Make parseFunc allowTags and denyTags optional
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Christian Kuhn +1
- Oliver Hader +1
-
Verified V +2 Done
- Benni Mack +2
- Christian Kuhn +1
- Oliver Hader +1
- core-ci +1 CI
Issues 1
Files 7
- typo3/sysext/core/Documentation/Changelog/13.2/Feature-104220-MakeParseFuncAllowTagsAndDenyTagsOptional.rstnew+69 −0
- typo3/sysext/fluid_styled_content/Configuration/TypoScript/Helper/ParseFunc.typoscript+0 −3
- typo3/sysext/fluid_styled_content/Tests/Functional/Rendering/SecureHtmlRenderingTest.php+7 −4
- typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php+10 −2
- typo3/sysext/frontend/Tests/Functional/SiteHandling/TypoLinkGeneratorTest.php+10 −5
- typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php4+4 −4
- typo3/sysext/frontend/ext_localconf.php+0 −2
Review log 1622
-
Benni Mack uploaded patch set 1 06/21/24, 11:59
-
core-ci voted on patch set 1 V -1 06/21/24, 12:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60004
-
Oliver Hader commented on patch set 1 06/24/24, 14:58
The failing functional tests in `\TYPO3\CMS\FluidStyledContent\Tests\Functional\Rendering\SecureHtmlRenderingTest::customParseFuncAvoidCrossSiteScripting` are based on the custom `parseFunc` configuration (provided in the test, not taken from fluid-styled-content). And in that scenario `denyTags` is empty - that's why it was passed before. From a security point of view, this was one of the reasons why we introduced `typo3/html-sanitizer` back then. From a backward compatibility view, I'd consider this a bug in the previous implementation - the tag `img/src` and `strong` were not explicitly allowed - but they were also not denied, that's why it worked.ContentObjectRendererTest.php:2085In addition having `allowTags=*` and `denyTags=*` would be great -
Benni Mack commented on patch set 1 06/25/24, 06:08
ContentObjectRendererTest.php:2085Replywhat would be your expected result? -
Oliver Hader uploaded patch set 2
V -106/25/24, 09:28 -
Oliver Hader commented on patch set 1 06/25/24, 09:32
Reply
I've adjusted the tests now - the case for `<img/src="img"/onerror="alert(1)">` was correctly handled and sanitized by `typo3/html-sanitizer` (Masterminds parser split by attributes by `/`, and our sanitizer removed the disallowed attribute `onerror`). With this change, `ContentObjectRenderer` is encoding the markup and `typo3/html-sanitizer` does not have to take any action. That's fine.ContentObjectRendererTest.php:2085ReplyI adjusted the tests to reflect the current behavior. From my point of view `denyTags=*` should take precedence. -
core-ci voted on patch set 2 V +1 06/25/24, 09:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60280
-
Oliver Hader uploaded patch set 3
V +106/26/24, 14:02 -
core-ci voted on patch set 3 V +1 06/26/24, 14:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60392
-
Oliver Hader commented on patch set 3 06/26/24, 15:13
ContentObjectRendererTest.php:2085ReplyDone -
Benni Mack uploaded patch set 4
V +106/26/24, 15:25 -
core-ci voted on patch set 4 V -1 06/26/24, 15:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60399
-
Oliver Hader commented on patch set 4 06/26/24, 17:27
The now failing functional tests in `TypoLinkGeneratorTest` are the result of the Masterminds parser, expanding `<good>` to `<good></good>` (this was directly encoded before removing the `allowTags` and `denyTags` from `ext_localconf.php`) -
Oliver Hader uploaded patch set 5
V -106/26/24, 17:55 -
Oliver Hader commented on patch set 5 06/26/24, 17:56
Reply
Done -
core-ci voted on patch set 5 V -1 06/26/24, 18:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60407
-
Oliver Hader uploaded patch set 6
V -106/27/24, 07:07 -
core-ci voted on patch set 6 V +1 06/27/24, 07:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60438
-
Oliver Hader voted on patch set 6 CR +1 V +1 06/27/24, 15:53
-
Christian Kuhn voted on patch set 6 CR +1 V +1 06/27/24, 15:58
-
Benni Mack voted on patch set 6 CR +2 V +2 06/27/24, 15:59
-
Benni Mack merged patch set 7 06/27/24, 15:59