-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
XSS vulnerability in html method #2795
Comments
I would say there are 3 possible ways to go here:
|
I think we should go with the first option. However, I think we should allow the user to disable the sanitizing in case they really want scripts to be executed. E.g. doc.html(html, {
callback: ...
allowScriptExecution: true/false // default: false
}) @AdamGold could you maybe prepare a pull request? If you don't have the time for that, I'll try it myself. Since I'm no expert in this field, I would very much appreciate if you could review it. To clarify: the |
@HackbrettXXX
|
The vulnerability on synk for documentation: https://snyk.io/vuln/SNYK-JS-JSPDF-575256 |
When using the html method, it is possible to inject code that is executed in the user context. E.g. like this:
E.g., this line seems to be suspicious: https://github.com/MrRio/jsPDF/blob/master/src/modules/html.js#L52.
We need to analyze how to fix this and if there is other vulnerable code.
The text was updated successfully, but these errors were encountered: