-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pasteHTML should prevent script execution #981
Comments
Sanitization is better handled outside of Quill and I'd rather not impose a set of rules, which are error-prone anyways. There are legitimate use cases for a Instead Quill will follow React's example of providing a very clear warning in the method name. |
thanks for your effort @jhchen
could be please give me some advice here? both CKEditor and TinyMCE have filter content feature. |
@jhchen is it possible to use as delta do all other work (e.g. convert tags and attributes) i guess it'll really fix this issue. I didn't look enough in code so I may be wrong.
tmpdoc = new DOMParser().parseFromString('<img src="" onerror="alert(\'it will not execute!\')">', "text/html");
console.log(tmpdoc.body.innerHTML); |
HTML sanitization is a huge mess. I would recommend not using HTML at all as a form of input and Quill has Deltas for this reason. The bright engineers at Facebook working on React seems to feel the same.
|
if something like
quill.pasteHTML('<img src="dfsdfds" onerror="alert(document)">')
called, thealert(document)
will be executed. I'm not sure if it's quill job to prevent this. I just want to make sure.Steps for Reproduction
Expected behavior:
Quill should sanitize unsafe attributes and tags.
Actual behavior:
See http://codepen.io/sijad/pen/NRAAdj
Platforms:
53.0.2785.116 (64-bit), osx 10.11.6
Version:
1.0.3
The text was updated successfully, but these errors were encountered: