CVE-2026-31938

MEDIUM EPSS 15.4%
Published Mar 18, 20263mo ago · Modified Jun 17, 20261w ago
6.1 CVSS 3.1
Medium
Find Similar
Published Mar 18, 2026 3mo ago
Last Modified Jun 17, 2026 1w ago

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.

CVSS Details

Base Score
6.1
Exploitability
2.8
Impact
2.7
Vector string
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Attack Vector Network
Attack Complexity Low
Privileges Required None
User Interaction Required
Scope Changed
Confidentiality Low
Integrity Low
Availability None

Threat Intelligence

EPSS Exploit Probability
15.4% percentile
Exploit & Patch Status
No Known Exploit
Patch Available

Weaknesses 1

CWE-79 Cross-site Scripting Injection

Affected Products 1

VendorProductVersionRange
paralljspdf* <4.2.1

References 3

  • github.com https://github.com/parallax/jsPDF/commit/87a40bbd07e6b30575196370670b41f264aa78d7
    Patch
  • github.com https://github.com/parallax/jsPDF/releases/tag/v4.2.1
    ProductRelease Notes
  • github.com https://github.com/parallax/jsPDF/security/advisories/GHSA-wfv2-pwc8-crg5
    MitigationVendor Advisory

Remediation

  • github.com https://github.com/parallax/jsPDF/commit/87a40bbd07e6b30575196370670b41f264aa78d7
    Patch