Cross-site scripting in jspdf - CVE-2026-31938
Published: April 27, 2026
jspdf
Detailed vulnerability description
The vulnerability allows a remote attacker to inject arbitrary HTML and execute script in the victim's browser context.
The vulnerability exists due to improper neutralization of input during web page generation in the output function when processing user-controlled output options for the "pdfobjectnewwindow", "pdfjsnewwindow", or "dataurlnewwindow" overloads. A remote attacker can supply specially crafted option values to inject arbitrary HTML and execute script in the victim's browser context.
User interaction is required because the victim must create and open the generated PDF in a browser.