Hi team,
I was working on the rich text editor, and for this input
Sorry for the fact that I have to use an image in this case
I would expect it to go like this
However, this is what I get when I use the syncfusion rich text editor
Just wondering if there is any setting that allows me to display the full html like that
|
<ejs-richtexteditor id="defaultRTE" enableHtmlSanitizer="true">
<e-content-template>
<ul><li>List 1</li><li>List 2</li></ul><p><br></p><p>List 3</p><p>List 4</p><p><br></p><p><script>alert("hacked")</script></p><p><b onmouseover = alert("XSSTesting!')></b></p>
</e-content-template>
</ejs-richtexteditor> |
Hi,
Sorry for the late reply. I tried that method and it's not quite the thing I want. If I disable the HTML Sanitizer, the dangerous text is being treated as a html element, not a text, which is not quite what I want. What I want is for the rtf to display this
and when I click on inspect on the browser, it should go like this, with all the < and > encoded
in case that thing is not possible, just wondering how you did the filtering thing? which tags are being sanitized?
|
<ejs-richtexteditor id="defaultRTE" enableHtmlSanitizer="false"
value="<ul><li>List 1</li><li>List 2</li></ul><p><br></p><p>List 3</p><p>List 4</p><p><br></p><p><script>alert('hacked')</script></p><p><b onmouseover = alert('XSSTesting!')></b></p>">
</ejs-richtexteditor>
|
|
'script',
'iframe[src]',
'link[rel='nofollow' href*="javascript:"]',
'object[type="text/x-scriptlet"]',
'object[data^="data:text/html;base64"]',
'img[src^="data:text/html;base64"]',
'[src^="javascript:"]',
'[dynsrc^="javascript:"]',
'[lowsrc^="javascript:"]',
'[type^="application/x-shockwave-flash"]' |
|
{ attribute: 'rel='nofollow' href', selector: '[rel='nofollow' href*="javascript:"]' },
{ attribute: 'background', selector: '[background^="javascript:"]' },
{ attribute: 'style', selector: '[style*="javascript:"]' },
{ attribute: 'style', selector: '[style*="expression("]' },
{ attribute: 'rel='nofollow' href', selector: 'a[rel='nofollow' href^="data:text/html;base64"]' }]; |
|
'onchange', 'onclick', 'onmouseover', 'onmouseout', 'onkeydown', 'onload', 'onerror', 'onblur',
'onfocus', 'onbeforeload', 'onbeforeunload', 'onkeyup', 'onsubmit', 'onafterprint', 'onbeforeonload', 'onbeforeprint',
'onblur', 'oncanplay', 'oncanplaythrough', 'onchange', 'onclick', 'oncontextmenu', 'ondblclick', 'ondrag', 'ondragend', 'ondragenter',
'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'ondurationchange', 'onemptied', 'onended', 'onerror', 'onerror',
'onfocus', 'onformchange', 'onforminput', 'onhaschange', 'oninput', 'oninvalid', 'onkeydown', 'onkeypress',
'onkeyup', 'onload', 'onloadeddata', 'onloadedmetadata', 'onloadstart', 'onmessage', 'onmousedown',
'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onoffline', 'onoine', 'ononline', 'onpagehide', 'onpageshow',
'onpause', 'onplay', 'onplaying', 'onpopstate', 'onprogress', 'onratechange', 'onreadystatechange', 'onredo', 'onresize', 'onscroll',
'onseeked', 'onseeking', 'onselect', 'onstalled', 'onstorage', 'onsubmit', 'onsuspend', 'ontimeupdate',
'onundo', 'onunload', 'onvolumechange', 'onwaiting', 'onmouseenter', 'onmouseleave', 'onmousewheel', 'onstart', 'onpropertychange' |
sorry for taking so long to answer, but your suggestion works. Thanks a lot!
Hi Tuan,
Welcome,
We are glad that your reported issue is resolved. Please get back to us if you need any further assistance.
Regards,
Indrajith