CVE-2026-31938Critical· 9.6▾ MidnightjsPDF is a library to generate PDFs in JavaScript. Prior to version 4.2.1, user control of the `options` argument of the `output` function allows attackers to inject arbitrary HTML (such as scripts) into the browser context the created P…
▾ Midnight zone — Critical, or high with PoC / in-the-wild
impact 52.8 · likelihood 0.1 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Jul 20.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via NVD
Last analysed / modified upstream
0.3%
jsPDF is a library to generate PDFs in JavaScript. Prior to version 4.2.1, user control of the options argument of the output function allows attackers to inject arbitrary HTML (such as scripts) into the browser context the created PDF is opened in. The vulnerability can be exploited in the following scenario: the attacker provides values for the output options, for example via a web interface. These values are then passed unsanitized (automatically or semi-automatically) to the attack victim. The victim creates and opens a PDF with the attack vector using one of the vulnerable method overloads inside their browser. The attacker can thus inject scripts that run in the victims browser context and can extract or modify secrets from this context. The vulnerability has been fixed in [email protected]. As a workaround, sanitize user input before passing it to the output method.
jspdf < 4.2.1Upgrade past the affected range:
jspdf 4.2.1Connected by shared product, vendor, weakness, or advisory.
CVE-2026-31898High· 8.1jsPDF is a library to generate PDFs in JavaScript
CVE-2026-25940High· 8.1jsPDF is a library to generate PDFs in JavaScript
CVE-2026-25755High· 8.1jsPDF is a library to generate PDFs in JavaScript
CVE-2026-25535High· 7.5jsPDF is a library to generate PDFs in JavaScript
CVE-2026-24737High· 8.1jsPDF is a library to generate PDFs in JavaScript
CVE-2025-68428High· 7.5jsPDF is a library to generate PDFs in JavaScript