Review 10.4 Merged

70537[BUGFIX] Adjust default behavior of HTML sanitization in parseFunc

Oliver Hader CR +2 V +2 Expert +887 −536 updated 08/16/21, 11:22

Commit message

As a result of TYPO3-CORE-SA-2021-013, new `htmlSanitize` behavior -
when invoking `ContentObjectRenderer::parseFunc` - is enabled per
default, in case it was not declared otherwise. That also happened
when no processing configuration was given (or could be resolved).
Without having any configuration, it was obviously not possible to
disable `htmlSanitize`.

Fluid's `HtmlViewHelper` can be used with an empty `parseFuncTSPath`
(e.g. `<f:format.html parseFuncTSPath="">`) - due to missing (empty)
configuration, sanitization was enabled per default in `parseFunc`.

With this change, property `htmlSanitize` either needs to be enabled
or disabled explicitly - otherwise deprecation logs will be generated,
if not given, the fall-back behavior is inferred from new feature flag
`security.frontend.htmlSanitizeParseFuncDefault`.

Invoking `ContentObjectRenderer::parseFunc` without any configuration
behaves like before TYPO3-CORE-SA-2021-013 was applied - it just does
not process anything.

Review

  • Code review CR +2 Done
    • Benni Mack +2
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 1

Files 13

Review log 1218

  1. Oliver Hader uploaded patch set 1 08/13/21, 08:36

  2. core-ci voted on patch set 1 V -1 08/13/21, 08:45 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/14896

  3. Wouter Wolters commented on patch set 1 08/13/21, 15:35

    ContentObjectRenderer.php:3761

    in the description it is stated is by default on but here you mark it as off by setting it to false. Is that correct?
  4. Oliver Hader commented on patch set 1 08/14/21, 06:25

    ContentObjectRenderer.php:3761 Reply Unresolved

    Previously `htmlSanitize` was enabled per default, if not given. With this change it is relaxed and disabled per default - but triggering that deprecation log, that integrators have to really make a decision in the future - and to explicitly(!) disable it. Where did you find it is "on by default"?
  5. Oliver Hader uploaded patch set 2 08/14/21, 06:27

  6. core-ci voted on patch set 2 V -1 08/14/21, 06:42 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15037

  7. Oliver Hader uploaded patch set 3 08/14/21, 06:56

  8. core-ci voted on patch set 3 V -1 08/14/21, 06:58 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15039

  9. Oliver Hader uploaded patch set 4 08/14/21, 09:10

  10. core-ci voted on patch set 4 V +1 08/14/21, 09:28 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15045

  11. Oliver Hader uploaded patch set 5 08/16/21, 09:47

  12. core-ci voted on patch set 5 V +1 08/16/21, 10:00 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15152

  13. Oliver Hader uploaded patch set 6 08/16/21, 10:30

  14. Oliver Hader marked it ready for review 08/16/21, 10:34

  15. Benni Mack voted on patch set 6 V +1 CR +1 08/16/21, 10:34

  16. core-ci commented on patch set 6 08/16/21, 10:40 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15155

  17. Benni Mack voted on patch set 6 V +2 CR +2 08/16/21, 11:22

  18. Benni Mack merged patch set 7 08/16/21, 11:22