Bug #95713
closed
Reports module and html sanitizer is limiting output (icon, javascript...)
Added by Yohann CERDAN about 3 years ago.
Updated about 2 years ago.
Description
Hi,
I use to maintain a complex reporting extension who use "Reports" (https://extensions.typo3.org/extension/additional_reports).
Since typo3 v11, reports apply a global sanitize to the output like this :
typo3/sysext/reports/Resources/Private/Templates/Report/Detail.html
{content -> f:transform.html() -> f:sanitize.html()}
But this is limiting us A LOT in the output, for example :
- we cannot use IconFactory like <core:icon identifier="apps-pagetree-page-default" size="small" /> in our StandaloneView
- we cannot include any javascript in our StandaloneView (i use to have a mini menu that filter datas)
Everything will be encoded, is it possible to find a workarround for this?
Thanks
- Status changed from New to Needs Feedback
Can you please point me to corresponding parts on GitHub that trigger those kind of markup?
- Related to Bug #95179: Transform internal URIs in backend user interface added
- Status changed from Needs Feedback to Under Review
Oliver Hader wrote in #note-3:
The only possibility I see is to remove -> f:sanitize.html()
from corresponding template, introduced in https://review.typo3.org/c/Packages/TYPO3.CMS/+/71020/4/typo3/sysext/reports/Resources/Private/Templates/Report/Detail.html
Allowing <script>
or similar with typo3/html-sanitizer
does not make much sense and contradicts the aim to mitigate potential cross-site scripting occurrences.
In order to be compatible with future content-security-policy headers, I'd suggest to
- avoid inline SVG, but use
<img src="icon.svg">
instead
- avoid inline JavaScript, but use a dedicated ES6 module (or RequireJS module) instead
Ok, for the <img src="icon.svg">
thats what i do but that's a shame we cannot use viewhelpers here.
And for the javascript, i agree too, BUT, i cannot add input,select,form,etc... to make my menu. The problem is the same here, we are very limited (in reports module of course).
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Related to Bug #97542: TYPO3 Module Reports throws Exception if no site exists added
- Status changed from Resolved to Closed
Also available in: Atom
PDF