-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
there was a xss both in img and a label #721
Comments
@WesCossick do you have an ETA on this issue ? If I want to provide a fix which files/functions do I have to look at ? |
#243 (comment) I'm not sure there's going to be a fix for this based on the comments above (which is absolutely insane and dangerous). Some people have gotten around this by setting |
I am not the author, but found this very helpful: |
This resolves medium severity XSS vulnerability which can be exploited when previewing malicious text in the editor. sparksuite/simplemde-markdown-editor#721 https://snyk.io/vuln/SNYK-JS-SIMPLEMDE-72570
This resolves medium severity XSS vulnerability which can be exploited when previewing malicious text in the editor. sparksuite/simplemde-markdown-editor#721 https://snyk.io/vuln/SNYK-JS-SIMPLEMDE-72570
After reading all the different issues and the helpful link above, I came up with my own solution to this problem that so far seems to do exactly what I wanted. Since the function setupMDE(elem=null) {
var opt = {
renderingConfig: {
codeSyntaxHighlighting: true
}
};
if (elem != null) {
opt["element"] = elem;
};
var simplemde = new SimpleMDE(opt);
// need to use the default rendering routine
simplemde.options.previewRender = function(plainText) {
return DOMPurify.sanitize(simplemde.markdown(plainText));
};
}; I discovered that using the old Let me know if anything can be improved. This could also be done async (see the simplemde docs) but DOMPurify seems to be fast enough for the scale of my app. Also note that even the |
I've learned that EasyMDE enables this much more easily by default. For anyone finding this, EasyMDE is a fork of this project that is still maintained as of 2020. |
when We enter some strings,such as:
</textarea><img/id="confirm(/xss/)"/alt="/"src="/"onerror=eval(id)>'">
or you can use
[asdasd](javascript:alert(1))
The editor will execute XSS payload
When others use this editor, it is easy to get administrator rights by using XSS attack.
The text was updated successfully, but these errors were encountered: