Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-31938

jsPDF has HTML Injection in New Window paths
Back to all
CVE

CVE-2026-31938

jsPDF has HTML Injection in New Window paths

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 jspdf@4.2.1. As a workaround, sanitize user input before passing it to the output method.

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
9.6
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L
C
H
U
0
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L
C
H
U
9.6
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L

Related Resources

No items found.

References

https://github.com/parallax/jsPDF/releases/tag/v4.2.1, https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31938.json, https://github.com/parallax/jsPDF/security/advisories/GHSA-wfv2-pwc8-crg5, https://nvd.nist.gov/vuln/detail/CVE-2026-31938, https://github.com/parallax/jsPDF/commit/87a40bbd07e6b30575196370670b41f264aa78d7

Severity

9.6

CVSS Score
0
10

Basic Information

Base CVSS
9.6
EPSS Probability
0.00244%
EPSS Percentile
0.15262%
Introduced Version
0
Fix Available
4562ce8aa35bd5ecd98cd5e262e3da2af96476f6,2.19.5-r2,2.19.5-r1,3.5.0-r9,3.5.0-r6

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading