Closed
Description
When using the html method, it is possible to inject code that is executed in the user context. E.g. like this:
const doc = new jsPDF();
window.html2canvas = html2canvas;
const html = `
<p id='test'>a</p>
<img src=x onerror=eval("document.getElementById('test').innerHTML=window.location") />
`;
doc.html(html, {
callback: function (doc) {
doc.save();
}
});
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.
Metadata
Metadata
Assignees
Labels
No labels