A WYSIWYG enables a user to enter rich text into an input field among other things.
However, the text and other content is submitted as HTML code.
These problems exist:
- A user can inject script tags into their input, posing a risk for XSS attacks. You cannot strip all tags because that would defeat the purpose of using a WYSIWYG editor.
- In addition to script tags, a user can use javascript attributes like onclick, onmousemove, etc…
What is the best way to go about validating and sanitizing the user input.
(Btw, using php for backend)