The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I have a markup string displaying the contents of the rich text editor on the website and I would like to know some more information about any security features of the rich text editor.
I am worried about someone being able to paste malicious javascript or html code in the rich text editor.
Is there anything built in to mitigate such an attack?
VJVinitha Jeyakumar Syncfusion Team August 12, 2022 01:12 PM UTC
Hi Pavel,
We have Cross-Site Scripting which is a security vulnerability and a client-side injection attack. Attackers inject the malicious code in a web application, usually JavaScript but could also be HTML or CSS. To prevent this aspect, the APIEnableHtmlSanitizeris provided and its default value is set to true.
If the user inserts special stuff into RichTextEditor....
like
<img src="\bbbb" onerror="alert('hahaha')"/>
Then the JS code still gets executed.
Can you advice proper way on how to achieve "no javascript at all" will be accepted scenario?
Thanks
VJVinitha Jeyakumar Syncfusion Team November 7, 2022 02:09 PM UTC
Hi Pavel,
When we set true to the EnableHtmlSanitizerin Rich Text Editor, the JS code didn't get executed and also that event is not added in the DOM element too. we have also used the code you have shared and prepared a sample and video illustration for your reference,