CVE-2026-31938

jsPDF has HTML Injection in New Window paths

MEDIUM
6.1
CVSS Score
Published: March 18, 2026 at 03:05 AM UTC
Updated: August 18, 2026 at 12:18 PM UTC
2 products affected across 2 vendorsJspdfjsPDF

Using jsPDF by parallax?

Get instant alerts when new vulnerabilities affect jsPDF - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM6.1
Exploit prediction
EPSS 0.3%
SSVC
No known exploit

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 4.2.1
Affected range stops below 4.2.1, so it looks safe — our inference, not a vendor statement
v < 4.2.1
Affected range stops below 4.2.1, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (8)

x_refsource_CONFIRMMitigationVendor Advisory
Source: cverecord
https://github.com/parallax/jsPDF/security/advisories/GHSA-wfv2-pwc8-crg5
x_refsource_MISCProductRelease Notes
Source: cverecord
https://github.com/parallax/jsPDF/releases/tag/v4.2.1
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://access.redhat.com/errata/RHSA-2026:7110
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://access.redhat.com/errata/RHSA-2026:7128
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://access.redhat.com/security/cve/CVE-2026-31938
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://bugzilla.redhat.com/show_bug.cgi?id=2448550

SSVC — Action Prioritization

SSVCNo known exploitNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
REQUIRED
Scope
CHANGED
Confidentiality
LOW
Integrity
LOW
Availability
NONE
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-79

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card