86820[TASK] Print raw inline CSS and improve HTML template
Commit message
Review
-
Code review CR -2
- Benjamin Franzke -2
- Oliver Hader -2
- Thomas Hohn +1
-
Verified V 0
- core-ci +1 CI
Issues 1
Files 1
Review log 2933
Show 68 earlier messages
-
Simon Schaufelberger uploaded patch set 1 10/29/24, 11:10
-
core-ci voted on patch set 1 V +1 10/29/24, 11:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68778
-
Garvin Hicking commented on patch set 1 10/29/24, 16:17
I am a bit unsure about the mixing of CGL and code change in this patch and would appreciate to split this up also to make reviewing easier, so that we don't have to possible fight about codestyle. ;-) (Unsure if for example old mail clients would need "0px" instead of "0" to work properly. Looking at you, Outlook-with-MS-Word-HTML-Rendering) -
Simon Schaufelberger uploaded patch set 2
V +110/29/24, 18:53 -
core-ci voted on patch set 2 V +1 10/29/24, 18:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68802
-
Simon Schaufelberger commented on patch set 2 10/29/24, 19:03
Reply
I have reverted the 0px stuff even though I don't think that this would cause an issue as there are lots of "0" used in the inline css block above. -
Benjamin Franzke commented on patch set 2 CR -1 10/29/24, 19:39
this is not a Bugfix, the "Bug" only happens when modifying the source. now, that's not a bug but only a task then, because the application itself does not run into an error on it's own. -
Benjamin Franzke commented on patch set 2 10/29/24, 19:40
not a priority thing, no Backport to 12.4
-
Simon Schaufelberger updated the commit message in patch set 3
CR -1V +110/29/24, 19:42 -
Simon Schaufelberger commented on patch set 3 10/29/24, 19:42
Reply
Acknowledged -
core-ci voted on patch set 3 V +1 10/29/24, 19:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68806
-
Garvin Hicking commented on patch set 3 CR +1 V +1 10/31/24, 15:07
Fine by me as cleanup -
Ayke Halder commented on patch set 3 11/05/24, 10:38
SystemEmail.html:21IMO this should be turned around. ``` <style type="text/css"><f:format.raw> … </f:format.raw></style> ``` -
Ayke Halder commented on patch set 3 11/05/24, 10:41
SystemEmail.html:425Do all the mail clients behave properly with multiple spaces added here? -
Simon Schaufelberger commented on patch set 3 11/05/24, 10:42
SystemEmail.html:21ReplyDone -
Simon Schaufelberger uploaded patch set 4
CR +1V +111/05/24, 10:42 -
Simon Schaufelberger commented on patch set 4 11/05/24, 10:45
SystemEmail.html:425ReplyAs this is an HTML email, it shouldn't matter. That would be a different story for plain text. -
core-ci voted on patch set 4 V +1 11/05/24, 10:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69094
-
Ayke Halder commented on patch set 4 CR +1 11/05/24, 10:58
SystemEmail.html:425ReplyAcknowledged -
Thomas Hohn voted on patch set 4 CR +1 11/11/24, 10:29
-
Benjamin Franzke commented on patch set 4 CR -2 11/11/24, 10:58
SystemEmail.html:21Blocking this from a security stand point. We will not wrap <f:format.raw> around ~300 lines of code. The introduces a drastically increased likelihood of security issue whenever CSS is added without manual escaping. I understand that this is a way to workaround possible fluid parser bugs for templates that derive from this one – but it is not better to introduce possible security problems in order to workaround possible parser bugs. -
Simon Schaufelberger commented on patch set 4 11/11/24, 11:03
SystemEmail.html:21ReplyCan you explain that a bit more in detail please? {} are fluid code for inline scripts and therefor the whole css block is parsed from fluid which should not happen because this is CSS and not fluid. How else should fluid know that this is CSS and should not be parsed? What possible security issues do you have in mind? I don't consider this as a parser bug as it was the decision to use these brackets. -
Andreas Kienast commented on patch set 4 11/11/24, 11:21
SystemEmail.html:21ReplyYour comment: > I don't consider this as a parser bug as it was the decision to use these brackets. Your commit message: > Fluid actually parses the inline CSS and stops working because of invalid syntax until the next valid ViewHelper appears. ??? -
Oliver Hader commented on patch set 4 11/11/24, 11:29
SystemEmail.html:21ReplyIn case there's any variable to be resolved within this new `f:format.raw` block - it would be rendered in an HTML context without proper escaping. Even if this variable does not exist yet in the code - how can be guaranteed, that it's not done in the future (and would lead to XSS then, in the future)? The actual fix would be to fix Fluid to either have a directive like `f:plain` (no parsing, no loops, no variable substitution, just take the input "as-is"). Or to have proper syntax escaping for Fluid literals, e.g. like escaping the curly braces in fluid like this ``` table \{ border-collapse:collapse; \} ``` -
Oliver Hader commented on patch set 4 CR -2 11/11/24, 11:30
I agree, that this might introduce new insecure spots... that's the reason for down-voting. -
Simon Schaufelberger commented on patch set 4 11/11/24, 11:34
SystemEmail.html:21ReplyThis is very easy to reproduce: create a contact form with an EmailToReceiver finisher Add under its options: ``` finishers: - identifier: EmailToReceiver options: ... variables: foo: 'bar' ``` Add the variable in the SystemEmail.html template: ``` <body> {foo} ``` Expected output: bar, actual output: `{foo}` More details in the reported issue. -
Benjamin Franzke commented on patch set 4 11/11/24, 11:46
SystemEmail.html:21Replythx @akienast@scripting-base.de, also see: https://github.com/TYPO3/Fluid/issues/808 where you actually already commented in https://github.com/TYPO3/Fluid/issues/808#issuecomment-2442928818 – so you should understand that this is a parser bug. Therefore I'll not discuss that topic here. The increased likelihood of security issue is the case because a large amount of code is outputted unescaped, that means it's likely that someone changes things without being aware that this ~300 lines code block is printed unescaped. The old documentation on that topic (which has unfortunately been removed) refered to use `<f:format.raw>{</f:format.raw>` only on the opening brackets that are not intended as inline notations. A copy of that documentation can be found here: https://maru-consulting.com/typo3conf/Documentation/typo3cms.guides.t3extbase/default/html/Fluid/ThingsToKnow/JsAndInline.html That's a better approach, which is still aweful, but less problematic from a security stand point. I would not block for that approach (but I'd also not vote for this patch, as I dislike these hacks so much that I can not vote positively) -
Simon Schaufelberger commented on patch set 4 11/11/24, 12:46
SystemEmail.html:21ReplyI understand your concerns. I'm a bit sad that there is no "good" solution to this issue. Would you approve the same patch just with the remaining code formatting? Then I will abandon this one. -
Ayke Halder commented on patch set 4 CR 0 11/11/24, 13:01
SystemEmail.html:21ReplyHow about using `f:format:stripTags`? Does using `stripTags` also solve the original issue? https://docs.typo3.org/other/typo3/view-helper-reference/main/en-us/Global/Format/StripTags.html Implementation of `stripTags`: https://github.com/TYPO3/Fluid/blob/3510df3031d978f3fb8128f973a9d70eddb99df8/src/ViewHelpers/Format/StripTagsViewHelper.php#L93-L104 ```php return strip_tags((string)$value, $allowedTags); ``` Expected security implications for `f:format:stripTags`: Any content that might be harmful is stripped of html-tags. The remaining content might become invalid CSS, but as it does not contain any html-tags, it does no harm anymore. -
Ayke Halder commented on patch set 4 11/11/24, 13:20
SystemEmail.html:21Reply UnresolvedIn general: Is it possible to use `f:asset.css` with inline CSS code here, instead of using `<style type="text/css">`? https://docs.typo3.org/other/typo3/view-helper-reference/main/en-us/Global/Asset/Css.html ```html <f:asset.css identifier="identifier123"> .foo { color: black; } </f:asset.css> ``` -
Benni Mack commented on patch set 4 04/11/25, 16:53
I will mark this as WIP, since this is stalled due to security purposes. -
Benni Mack marked it work in progress 04/11/25, 16:53
-
Simon Schaufelberger abandoned the change 09/03/26, 10:14
New approach here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/95592