CVE catalog

CVE-2026-31938

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) i

[CVE catalog]

Severity
Critical · CVSS 9.6CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L
Published
Source
[NVD] · [CVE record]
EPSS
0.27% · Oct 25, 2026

A flaw was found in jsPDF, a JavaScript library for generating PDFs. A remote attacker can exploit this vulnerability by providing malicious input to the `options` argument of the `output` function. When a victim creates and opens a PDF using this unsanitized input, arbitrary HTML, including scripts, can be injected and executed within the victim's browser context. This Cross-Site Scripting (XSS) vulnerability allows the attacker to extract or modify sensitive information from the victim's browser. jspdf: jsPDF: Cross site scripting via unsanitized output options The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.

Vulnerable and fixed packages

Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.

DistributionPackageReleaseVersionStatus
NpmjspdfNot reported4.2.1fixed
CpejspdfNot reportedNot reportedunknown
CpejspdfNot reported4.2.1fixed

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
NpmjspdfnpmNot reported4.2.1Not reportedNot reportedNot reported
CpejspdfcpeNot reported4.2.1Not reportedNVD-CVE-2026-31938Not reported

OpenFactory catalog packages

No matching packages in this catalog.

Observed:

References