CVE-2026-31938
published critical CVSS 3.1 · 9.6jsPDF has HTML Injection in New Window paths
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| parallax | — | jsPDF< 4.2.1 | Affected | Not stated | GitHub_M |
| Red Hat | — | advanced-cluster-security/rhacs-main-rhel8Red Hat Advanced Cluster Security 4.8 · 1775594119 and later · Other versions: affected | Unaffected | Not stated | redhat-SADP |
| Red Hat | — | advanced-cluster-security/rhacs-main-rhel8Red Hat Advanced Cluster Security 4.9 · 1775594284 and later · Other versions: affected | Unaffected | Not stated | redhat-SADP |
Description
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.
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 9.6 / 10
- Severity
- critical
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L
Additional Assessments
| Version | Score | Severity | Provider | Vector | Scenarios |
|---|---|---|---|---|---|
| 3.1 | 8.1 | high | redhat-SADP · adp | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N | — |
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| parallax | jsPDF | < 4.2.1 (affected) | GitHub_M · cna |
| Red Hat | Red Hat Advanced Cluster Security 4.8 | 1775594119 and later (unaffected · rpm)Default: affected | redhat-SADP · adp |
| Red Hat | Red Hat Advanced Cluster Security 4.9 | 1775594284 and later (unaffected · rpm)Default: affected | redhat-SADP · adp |
Weaknesses
2- CWE-79 CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
- CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
References
8- https://access.redhat.com/errata/RHSA-2026:7110
- https://access.redhat.com/errata/RHSA-2026:7128
- https://access.redhat.com/security/cve/CVE-2026-31938
- RHBZ#2448550 https://bugzilla.redhat.com/show_bug.cgi?id=2448550
- https://github.com/parallax/jsPDF/commit/87a40bbd07e6b30575196370670b41f264aa78d7
- https://github.com/parallax/jsPDF/releases/tag/v4.2.1
- https://github.com/parallax/jsPDF/security/advisories/GHSA-wfv2-pwc8-crg5
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31938.json
Provider assertions
3GitHub_M · cna
jsPDF has HTML Injection in New Window paths
redhat-SADP · adp
jspdf: jsPDF: Cross site scripting via unsanitized output options
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 13a56349e7c7dc21332b98e96355efdc337ca6ed26169e029dc386e54ff65ab7
- Ingested
- 23 Sep 2026, 09:09:43 UTC
- Source record
- Official CVE record