---
id: CVE-2026-25755
title: jsPDF is a library to generate PDFs in JavaScript
summary: >-
  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 …
severity: high
cvss: 8.1
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N'
cwe:
  - CWE-94
  - CWE-116
  - CWE-94
vendor: parall
product: jspdf
affected:
  - jspdf < 4.2.0
patched:
  - jspdf 4.2.0
published: '2026-02-19'
updated: '2026-06-30'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-25755'
references:
  - url: 'https://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25755.md'
    label: security-advisories@github.com
  - url: >-
      https://github.com/parallax/jsPDF/commit/56b46d45b052346f5995b005a34af5dcdddd5437
    label: security-advisories@github.com
  - url: 'https://github.com/parallax/jsPDF/releases/tag/v4.2.0'
    label: security-advisories@github.com
  - url: 'https://github.com/parallax/jsPDF/security/advisories/GHSA-9vjf-qc39-jprp'
    label: security-advisories@github.com
  - url: 'https://access.redhat.com/errata/RHSA-2026:7110'
    label: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
  - url: 'https://access.redhat.com/errata/RHSA-2026:7128'
    label: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
  - url: 'https://access.redhat.com/security/cve/CVE-2026-25755'
    label: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2440993'
    label: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-25755.json
    label: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
tags:
  - nvd
  - exploit-available
epss: 0.00801
epssPercentile: 0.54756
ingestedAt: '2026-07-03T18:53:52.439Z'
exploits:
  github: 1
  githubRepos:
    - 'https://github.com/absholi7ly/jsPDF-Object-Injection'
  checkedAt: '2026-09-26T09:05:40.684Z'
exploitAvailable: true
---

## Overview

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.

## Affected

- `jspdf < 4.2.0`

## Remediation

Upgrade past the affected range:

- `jspdf 4.2.0`
