CVE-2026-31938 json
jsPDF has HTML Injection in New Window paths
published 2026-03-17 7 mo ago modified 2026-09-10 1 mo ago also GHSA-wfv2-pwc8-crg5 , EUVD-2026-12755
- cvss
- 9.6
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.3%
- EPSS 0.3% chance of exploitation in 30 days, percentile 20%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- npm jspdf 4.2.1
- Red Hat Red Hat Advanced Cluster Security 4.8 1775594119
- Red Hat Red Hat Advanced Cluster Security 4.9 1775594284
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2026-31938 updated cvss 8.1
jspdf: jsPDF: Cross site scripting via unsanitized output options
-
Red Hat Advanced Cluster Security 4.8 advanced-cluster-security 1775594119fixed: vendor fix RHSA-2026:7110
-
Red Hat Advanced Cluster Security 4.9 advanced-cluster-security 1775594284fixed: vendor fix RHSA-2026:7128
-
Red Hat Advanced Cluster Security 4.8 advanced-cluster-security 1774163438, advanced-cluster-security 1774294180, advanced-cluster-security 1775594119 Red Hat Advanced Cluster Security 4.9 advanced-cluster-security 1774260292, advanced-cluster-security 1774294136, advanced-cluster-security 1775594284not affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 7 mo ago
Exploit prediction
0.28% chance of exploitation in the next 30 days, higher than 20% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 9.6 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L |
| CISA ADP | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N |
| NVD | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| CNA | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N |
| GitHub | 3.1 | 9.6 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | jspdf | <4.2.1 |
4.2.1 |
Affected products
- parallax jsPDF
- Red Hat Red Hat Advanced Cluster Security 4.8
- Red Hat Red Hat Advanced Cluster Security 4.9
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
References
-
github.com
/parallax/jsPDF/commit/87a40bbd07e6b30575196370670b41f264aa78d7
web, patch
-
access.redhat.com
/errata/RHSA-2026:7110
vendor-advisory
-
access.redhat.com
/errata/RHSA-2026:7128
vendor-advisory
-
github.com
/parallax/jsPDF/security/advisories/GHSA-wfv2-pwc8-crg5
web, mitigation, vendor-advisory
-
github.com
/parallax/jsPDF/releases/tag/v4.2.1
web, product, release-notes
-
access.redhat.com
/security/cve/CVE-2026-31938
vdb-entry
-
bugzilla.redhat.com
/show_bug.cgi?id=2448550
issue-tracking
- security.access.redhat.com /data/csaf/v2/vex/2026/cve-2026-31938.json
-
nvd.nist.gov
/vuln/detail/CVE-2026-31938
advisory
-
github.com
/parallax/jsPDF
package
Sources
- CVE List CVE-2026-31938
- GitHub Advisory GHSA-wfv2-pwc8-crg5
- NVD CVE-2026-31938
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.