I use:
DB: SQL Server
Server: MVC5 / C# / .NET 4.7
Firewall: Cloudflare WAF
Client: HTML, CSS, Javascriptm JQuery.
I use the Cloudflare WAF for my application which accepts HTML elements in the richtext edit field. I use the CKEditor to enable these edit fields. However I am finding that much of the pasted HTML text is triggering the WAF OWASP rules, and in many cases as a false positive.
One can Base-64 encode the string clientside, but this may mask dodgey string from the WAF. For example will still run when decoded back into the browser.
What is a good approach for dealing with this issue? The only other ideas I have had is to
a) Only allow plain text which would be restrictive.
b) Use some form of clientside cleaning utility to sanitize the text before it is uploaded to remove any dodgey code.
I would welcome some best practice advice and any tools that I could investigate further.