CVE-2026-31938: parallax jsPDF · Cross-site Scripting
Affects parallax jsPDFSource CVE Database V5
Not known to be exploited · CVSS 9.6 Critical : upgrade to 4.2.1 as a priority.
Data as of 30 Oct 2026, 11:52 UTC
Contested
Critical score, yet low EPSS after six months- EPSS
- 0.2% chance of exploitation in 30 days – higher than 19% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 4.2.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:LExploitation evidence
Disclosed: evidence found.
CVE published 18 Mar 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 30 Oct 2026.
What to do
Upgrade jsPDF and jspdf to 4.2.1.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| parallaxjsPDF | Affected
| Fixed in
|
npmjspdfpkg:npm/jspdfOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A fix is available in jsPDF version 4.2.1. Users should upgrade to this version to remediate the vulnerability. As a workaround, sanitize all user-supplied input passed to the output function's options argument to prevent injection of malicious HTML or scripts. Red Hat notes that no other mitigation currently meets their criteria for ease of use and applicability. Therefore, upgrading is the recommended remediation.
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 jspdf@4.2.1. As a workaround, sanitize user input before passing it to the output method.
References
- github.com/parallax/jsPDF/security/advisories/GHSA-wfv2-pwc8-crg5 (opens in a new tab)
- github.com/parallax/jsPDF/commit/87a40bbd07e6b30575196370670b41f264aa78d7 (opens in a new tab)
- github.com/parallax/jsPDF/releases/tag/v4.2.1 (opens in a new tab)
- access.redhat.com/security/cve/CVE-2026-31938 (opens in a new tab)
- bugzilla.redhat.com/show_bug.cgi?id=2448550 (opens in a new tab)
- security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31938.json (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:7110 (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:7128 (opens in a new tab)