-
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
Cross-site scripting vulnerability in ParseDown #530
Comments
duplicate of #161 |
Fixed in #495 if you’d like to test it. |
@aidantwoods Can I ask why this has not been merged into master yet, as this XSS vulnerability is quite serious? |
@embluk I'd love to see it merged into master, but unfortunately I don't have write rights on this repo. If you're a composer user you can take a look at https://packagist.org/packages/aidantwoods/secureparsedown, or https://github.com/aidantwoods/SecureParsedown otherwise to apply the patch via a class extension. |
@aidantwoods Thanks for all your great work on this! However, I cannot seem to get it working. I'm pretty sure its nothing on your side and something with the way I'm setting it up. I have the following:
And I get this error: |
From the error it looks like you're perhaps declaring this within a function in the surrounding context? PHP's In the desired case, it is for importing – so you'd need to place the Alternatively if that's not practical, just instantiate the class by using its fully qualified name, i.e. change |
Ohh yeah I had my previous code block within a wrapper class, inside a function. It now works with using the fully qualified name. Thanks for your rapid response and support! Keep up the good work! |
It's been a busy couple of months for me, I'll merge it as soon as I have some time to get my head around the code. |
Anyone using the |
The code above simply creates an instance of your Parsedown parser and then creates an image in markdown. This creation of the image is vulnerable to XSS. I would advice something like HTML encoding some of the input in certain places (especially for things like quotes).
The text was updated successfully, but these errors were encountered: