CVE-2026-31938: jsPDF is a library to generate PDFs in JavaScript
CVE-2026-31938 is a critical-severity flaw (CVSS 9.6) affecting jspdf. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.
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 (automa
Why this priority
- Critical severity
A fixed release or distro patch exists.
Risk facts
| CVSS score | 9.6 (Critical) |
| Attack vector | Network (remote) |
| Attack complexity | Low |
| Privileges needed | None |
| User interaction | Required |
| EPSS exploit chance | 0.3% (top 80%) |
| CISA exploited list | No |
| Weakness | CWE-79 |
| Published | 2026-03-18 |
| Last modified | 2026-08-18 |
Last updated 2026-08-18 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score
Am I affected?
Timeline
- Published CVE record published
- Updated Record last modified
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.
Quick answers
How do I fix CVE-2026-31938?
jspdf: upgrade to 4.2.1. Exact commands for each OS are on this page.
Is CVE-2026-31938 being exploited?
CVE-2026-31938 is not on the CISA Known Exploited Vulnerabilities list at the time of the last update. Check again, as this can change.
What does CVE-2026-31938 affect?
CVE-2026-31938 affects jspdf. Severity is critical (CVSS 9.6). 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
How urgent is CVE-2026-31938?
Priority 39/100. Critical severity
Related CVEs
- CVE-2025-68428 HIGH 7.5 UPGRADE jsPDF is a library to generate PDFs in JavaScript
- CVE-2026-31898 HIGH 8.1 UPGRADE jsPDF is a library to generate PDFs in JavaScript
- CVE-2026-24737 HIGH 8.1 UPGRADE jsPDF is a library to generate PDFs in JavaScript
- CVE-2026-24133 MEDIUM 6.5 UPGRADE jsPDF is a library to generate PDFs in JavaScript
- CVE-2026-24043 MEDIUM 5.4 UPGRADE jsPDF is a library to generate PDFs in JavaScript