Skip to content
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

Code Injection bug #83

Closed
ghost opened this issue May 23, 2019 · 1 comment
Closed

Code Injection bug #83

ghost opened this issue May 23, 2019 · 1 comment
Assignees

Comments

@ghost
Copy link

ghost commented May 23, 2019

  1. download the file(https://github.com/cujanovic/Markdown-XSS-Payloads/blob/master/Markdown-XSS-Payloads.txt) rename to 123.md

  2. run mistletoe 123.md > out.html

  3. open out.html

image

how to fix it,

thank you very much

@ghost ghost closed this as completed Jun 5, 2019
@miyuchina
Copy link
Owner

Thank you for this--I don't actually think, though, that it is up to the parser to strip user input of malicious content. Especially since mistletoe is written in Python, its output is less likely (than some JavaScript parsers, at least) to be hooked directly into a front-end. Stripping html tags, as discussed in #74, might be a possibility, but still cannot prevent XSS injections completely, and I don't feel capable doing a security audit of Markdown anyways.

This came up in my brief research of the topic, which might also be helpful: Showdown, a JavaScript parser, recommends that users do XSS filtering after the Markdown parser has finished producing HTML.

Sorry I won't be able to fix this. I'll nevertheless add a note in the documentation about XSS injections, and I'll keep this issue open for now.

@miyuchina miyuchina reopened this Jun 8, 2019
@miyuchina miyuchina self-assigned this Jun 8, 2019
@ghost ghost closed this as completed Jan 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant