CVE-2026-25755
Modified Modified - Updated After Analysis

JavaScript Injection in jsPDF addJS Method Allows PDF Manipulation

Vulnerability report for CVE-2026-25755, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-02-19

Last updated on: 2026-06-30

Assigner: GitHub, Inc.

Description

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.0, user control of the argument of the `addJS` method allows an attacker to inject arbitrary PDF objects into the generated document. By crafting a payload that escapes the JavaScript string delimiter, an attacker can execute malicious actions or alter the document structure, impacting any user who opens the generated PDF. The vulnerability has been fixed in [email protected]. As a workaround, escape parentheses in user-provided JavaScript code before passing them to the `addJS` method.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-02-19
Last Modified
2026-06-30
Generated
2026-07-06
AI Q&A
2026-02-19
EPSS Evaluated
2026-07-05
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
parall jspdf to 4.2.0 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-116 The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.
CWE-94 The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

The vulnerability exists in the jsPDF library versions prior to 4.2.0, specifically in the `addJS` method. This method allows users to add JavaScript code to the generated PDF. However, because user input is not properly sanitized, an attacker can craft a payload that escapes the JavaScript string delimiter. This enables the injection of arbitrary PDF objects into the document, potentially allowing malicious actions or alteration of the PDF's structure when the document is opened.

Impact Analysis

If you use a vulnerable version of jsPDF and allow user input to be passed to the `addJS` method without proper escaping, an attacker can inject malicious code into the generated PDF. This can lead to execution of harmful actions when the PDF is opened, or manipulation of the document's content and structure. Such impacts can affect any user who opens the compromised PDF, potentially leading to security breaches or data integrity issues.

Compliance Impact

I don't know

Detection Guidance

I don't know

Mitigation Strategies

To mitigate this vulnerability, upgrade the jsPDF library to version 4.2.0 or later where the issue is fixed.

As a workaround, escape parentheses in any user-provided JavaScript code before passing it to the addJS method to prevent injection.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-25755. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart