CVE-2026-25755

jsPDF has PDF Object Injection via Unsanitized Input in addJS Method

Published Feb 19, 2026 CVSS 3.1 · 8.1 High EPSS < 1% KEV · Not listed
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 jspdf@4.2.0. As a workaround, escape parentheses in user-provided JavaScript code before passing them to the `addJS` method.

Analysis

AI-generated

Technical impact

jsPDF is a JavaScript library that generates PDFs. In versions prior to 4.2.0 the addJS method accepts a user‑supplied argument without sanitization, allowing an attacker to inject arbitrary PDF objects by escaping the JavaScript string delimiter. The injected objects can contain malicious code or alter the document structure, so anyone who opens the resulting PDF may trigger code execution or compromise the integrity of the document.

Affected Systems

The vulnerability affects the Parallax jsPDF library in all releases older than 4.2.0. Any application that incorporates jsPDF before that version and calls addJS with external input is potentially exposed. The issue is fixed in jsPDF 4.2.0 and later releases.

Risk and Exploitability

With a CVSS score of 8.1, the risk is considered high, but the EPSS score of less than 1 % indicates a very low probability of current exploitation. It is not listed in the CISA KEV catalog. The attack vector is likely through user‑generated data supplied to addJS; the attacker must craft a payload that escapes the JavaScript string. Successful exploitation would allow execution of arbitrary PDF objects, potentially leading to code execution or document tampering when a victim opens the file.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade jsPDF to version 4.2.0 or newer immediately.
  • If an upgrade cannot be performed, escape parentheses in all user‑provided JavaScript code before passing it to the addJS method as a temporary workaround.
  • Audit all usage of addJS in your codebase, restrict the input to trusted sources, or disable the method for untrusted content.

Generated by OpenCVE AI on April 17, 2026 at 18:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-9vjf-qc39-jprp jsPDF has a PDF Object Injection via Unsanitized Input in addJS Method
History
Type Values Removed Values Added
CPEs cpe:2.3:a:parall:jspdf:*:*:*:*:*:node.js:*:*
Type Values Removed Values Added
First Time appeared Parall
Parall jspdf
Vendors & Products Parall
Parall jspdf
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
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 jspdf@4.2.0. As a workaround, escape parentheses in user-provided JavaScript code before passing them to the `addJS` method.
Title jsPDF has PDF Object Injection via Unsanitized Input in addJS Method
Weaknesses CWE-116
CWE-94
References
Metrics cvssV3_1

{'score': 8.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N'}

Weaknesses
  • CWE-116

    Improper Encoding or Escaping of Output

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 7, 2026, 12:05 PM
Reserved
Feb 5, 2026, 6:35 PM
Status
Modified
Published
Feb 19, 2026, 3:16 PM
Modified
Aug 18, 2026, 12:17 PM
Severity
Important
Public date
Feb 19, 2026, 2:41 PM