FlashMessage renderers must not escape user content
With https://forge.typo3.org/issues/78477, the flash message handling unfortunatey became worse compared to 7.6 because it tried to do things the right way but it didn't have real life projects in mind.
These are the changes I struggle with a lot:
- The FlashMessageRendererResolver resolves the Renderer by some hardcoded conditions. Backend, Frontend and CLI-Context. This is not only very breaking because the default rendering was the Bootstrap-Rendering in 7.6, it also takes away the possibility to configure the renderer. It's a slap in the face when migrating templates to 8.7.
- Due to security reasons, the renderers escape all output-, but the FlashMessageViewHelper is still configure to not escape its output-. This takes the option from me of not escaping stuff for single flash messages in case I need to. This has to change. Renderers must not htmlspecialchar and let the
template engineuser decide. I understand that we do not want to open the doors for XSS by default (and we can do so by using sane defaults for the renderer configuration letting the flashmessage viewhelper escape by default, which can then be overridden) but there are cases, and it's many, where you want to disable escaping in flash messages.
#3 Updated by Alexander Schnitzler over 1 year ago
Benni Mack wrote:
As this is going back and forth, this should be discussed properly before creating patches (changes of changes of changes again) IMHO. I do understand the use case, of course, but just saying...
I am in for a discussion. And let me emphasize again. It's not about reverting the changes. I am ok with safety first but I pretty much dislike when the core changes things and my only chance to get back previous features is to xclass while it's quite easy to make things configurable. If I can choose the escaping and the renderer in the view, maybe as arguments of the flash message view helper, I am totally ok with sane, secure defaults. But the current approach is a big no go, UX-wise.