---
title: "CVE-2026-31938: jsPDF has HTML Injection in New Window paths"
url: https://erroneo.us/security/cve/CVE-2026-31938/
description: "CVE-2026-31938 (jspdf (npm)): jsPDF is a library to generate PDFs in JavaScript. Prior to version 4.2.1, user control of the options argument of the output…"
type: vulnerability-record
section: "Security Digest"
date_published: 2026-03-18
date_modified: 2026-09-07
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2026-31938"
kev: false
cvss: 9.6
epss: 0.0042
license: All rights reserved. Quote with attribution and a link.
---

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

**Signal:** Critical and remotely reachable. No known exploitation yet, but it is network-reachable without credentials. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 0.4% , percentile 35: FIRST’s model estimates a 0.4% chance of exploitation activity in the next 30 days, higher than 35% of all scored CVEs (low). EPSS is a probability, not a verdict.
- Needs a user to click or open something. Phishing makes that realistic, but it is not wormable.
- Only applies if your dependency tree includes jspdf (npm) <= 4.2.0, fixed in 4.2.1 . Check your lockfile, including transitive dependencies.

## What it is

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.

## Affected packages

- npm `jspdf` <= 4.2.0 → fixed: 4.2.1

## Affected products (CVE record)

- parallax jsPDF: < 4.2.1

## Severity

- GitHub_M CVSS 3.1: 9.6 `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 `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 `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none , automatable no , technical impact total .
- FIRST EPSS (model of 2026-10-21): 0.42% probability of exploitation activity in the next 30 days; percentile 35.

## Sources

- [access.redhat.com](https://access.redhat.com/errata/RHSA-2026:7110)
- [access.redhat.com](https://access.redhat.com/errata/RHSA-2026:7128)
- [GitHub Advisory GHSA-wfv2-pwc8-crg5](https://github.com/advisories/GHSA-wfv2-pwc8-crg5)
- [CVE.org record CVE-2026-31938](https://www.cve.org/CVERecord?id=CVE-2026-31938)
- [NVD entry CVE-2026-31938](https://nvd.nist.gov/vuln/detail/CVE-2026-31938)
- [github.com](https://github.com/parallax/jsPDF/security/advisories/GHSA-wfv2-pwc8-crg5)
- [github.com](https://github.com/parallax/jsPDF/commit/87a40bbd07e6b30575196370670b41f264aa78d7)
- [github.com](https://github.com/parallax/jsPDF/releases/tag/v4.2.1)
- [access.redhat.com](https://access.redhat.com/security/cve/CVE-2026-31938)
- [RHBZ#2448550](https://bugzilla.redhat.com/show_bug.cgi?id=2448550)
- [security.access.redhat.com](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31938.json)

---
Source page: https://erroneo.us/security/cve/CVE-2026-31938/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
