# CVE-2026-31938: jsPDF has HTML Injection in New Window paths

- Severity: Critical 9.6 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.32%, higher than 26% of CVEs (2026-12-01)
- Published: 2026-03-17T17:07:59.000Z
- Modified: 2026-09-10T03:50:41.577Z
- Also known as: GHSA-wfv2-pwc8-crg5
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- parallax jsPDF: < 4.2.1
- advanced-cluster-security/rhacs-main-rhel8: no versions given (not affected: from 1775594119 before *; from 1775594284 before *)
- jspdf (npm): before 4.2.1
- parall jspdf: before 4.2.1

## Every score

- GitHub_M: CVSS:3.1 9.6 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L`
- redhat-SADP: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N`
- GitHub: CVSS:3.1 9.6 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/parallax/jsPDF/security/advisories/GHSA-wfv2-pwc8-crg5> (mitigation, vendor-advisory, web)
- <https://github.com/parallax/jsPDF/commit/87a40bbd07e6b30575196370670b41f264aa78d7> (patch, web)
- <https://github.com/parallax/jsPDF/releases/tag/v4.2.1> (product, release-notes, web)
- <https://access.redhat.com/security/cve/CVE-2026-31938> (vdb-entry)
- <https://bugzilla.redhat.com/show_bug.cgi?id=2448550> (issue-tracking)
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31938.json>
- <https://access.redhat.com/errata/RHSA-2026:7110> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2026:7128> (vendor-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-31938> (advisory)
- <https://github.com/parallax/jsPDF> (package)

## Sources

- CVE List: [CVE-2026-31938](https://www.cve.org/CVERecord?id=CVE-2026-31938), CVE Terms of Use, modified 2026-09-07
- GitHub Advisory Database: [GHSA-wfv2-pwc8-crg5](https://github.com/advisories/GHSA-wfv2-pwc8-crg5), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-31938](https://nvd.nist.gov/vuln/detail/CVE-2026-31938), Public domain, modified 2026-08-18

---

Page: https://cve.day/CVE-2026-31938 · Whole record: https://cve.day/CVE-2026-31938.json · Rebuilt by cve.day 2026-11-25T22:59:16.085Z
