Quick answers
- Is CVE-2026-31938 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2026-31938 being exploited in the wild.
- How severe is CVE-2026-31938?
- Critical severity, with a CVSS score of 9.6, published 18 March 2026.
- Which products and versions are affected?
- jspdf (npm) SEMVER:introduced=0,fixed=4.2.1.
- Is there a fix for CVE-2026-31938?
- Yes. jspdf (npm): upgrade to 4.2.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2026-31938 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2026-31938?
- Check whether you run jspdf (npm) or Red Hat Advanced Cluster Security for Kubernetes at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- jspdf (npm): upgrade to 4.2.1 or later
npm install jspdf@4.2.1
Technical details
A Cross-Site Scripting (XSS) vulnerability exists in jsPDF versions prior to 4.2.1 due to improper neutralization of the 'options' argument in the 'output' function. Specifically, when using method overloads such as 'pdfobjectnewwindow', 'pdfjsnewwindow', or 'dataurlnewwindow', parameters like 'pdfObjectUrl', 'pdfJsUrl', and 'filename' are included in generated HTML strings without sufficient sanitization. An attacker can provide a malicious payload (e.g., breaking out of an iframe or script tag) that executes arbitrary JavaScript in the victim's browser context when the PDF is rendered. This is a client-side vulnerability requiring user interaction (the victim must trigger the PDF generation/opening). The issue is fixed in version 4.2.1 by properly encoding these options.
Affected products
- parallax jsPDF < 4.2.1
- Red Hat Red Hat Advanced Cluster Security for Kubernetes 4.8
- Red Hat Red Hat Advanced Cluster Security for Kubernetes 4.9
Identifiers
- CVE-2026-31938
- GHSA-wfv2-pwc8-crg5
Timeline
- 2026-03-17: patched: Fixes committed and version 4.2.1 released.
- 2026-03-17: advisory: GitHub Security Advisory GHSA-wfv2-pwc8-crg5 published.
- 2026-03-18: disclosed: CVE-2026-31938 published to NVD.
References
- 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://access.redhat.com/errata/RHSA-2026:7110
- https://access.redhat.com/errata/RHSA-2026:7128
- https://access.redhat.com/security/cve/CVE-2026-31938
- https://bugzilla.redhat.com/show_bug.cgi?id=2448550