CVE-2026-31938

9.6 CRITICAL
Published: March 18, 2026 Modified: March 18, 2026
View on NVD

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.

AI Explanation

Get an AI-powered plain-language explanation of this vulnerability and remediation steps.

Login to generate AI explanation

CVSS v3.x Details

0.0 Low Medium High Critical 10.0
Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L

References to Advisories, Solutions, and Tools

Patch Vendor Advisory Exploit Third Party Advisory
https://github.com/parallax/jsPDF/releases/tag/v4.2.1
Source: security-advisories@github.com
Product Release Notes
https://github.com/parallax/jsPDF/security/advisories/GHSA-wfv2-pwc8-crg5
Source: security-advisories@github.com
Mitigation Vendor Advisory

3 reference(s) from NVD

Quick Stats

CVSS v3 Score
9.6 / 10.0
EPSS (Exploit Probability)
0.0%
11th percentile
Exploitation Status
Not in CISA KEV

Weaknesses (CWE)

Affected Vendors

parall