CVE-2026-25535
JSON

8.7high

jsPDF Affected by Client-Side/Server-Side Denial of Service via Malicious GIF Dimensions

Severity
8.7high CVSS:4.0 by GitHub_M
Exploit likelihood
1.09% (higher than 65% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-67pg-wm7f-q7fj

Description

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.0, user control of the first argument of the `addImage` method results in denial of service. If given the possibility to pass unsanitized image data or URLs to the `addImage` method, a user can provide a harmful GIF file that results in out of memory errors and denial of service. Harmful GIF files have large width and/or height entries in their headers, which lead to excessive memory allocation. Other affected methods are: `html`. The vulnerability has been fixed in jsPDF 4.2.0. As a workaround, sanitize image data or URLs before passing it to the addImage method or one of the other affected methods.

Affected

Product or packageVersionsReported by
parallax jsPDF< 4.2.0CVE List
advanced-cluster-security/rhacs-main-rhel8Not specified
Not affected: from 1775594119 before *, from 1775594284 before *
CVE List
jspdf (npm)before 4.2.0GitHub Advisory Database
parall jspdfbefore 4.2.0NVD

All scores

GitHub_M8.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
redhat-SADP7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-400CWE-770

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.0, user control of the first argument of the `addImage` method results in denial of service. If given the possibility to pass unsanitized image data or URLs to the `addImage` method, a user can provide a harmful GIF file that results in out of memory errors and denial of service. Harmful GIF files have large width and/or height entries in their headers, which lead to excessive memory allocation. Other affected methods are: `html`. The vulnerability has been fixed in jsPDF 4.2.0. As a workaround, sanitize image data or URLs before passing it to the addImage method or one of the other affected methods.

GitHub Advisory Database
Impact

User control of the first argument of the addImage method results in denial of service.

If given the possibility to pass unsanitized image data or URLs to the addImage method, a user can provide a harmful GIF file that results in out of memory errors and denial of service. Harmful GIF files have large width and/or height entries in their headers, wich lead to excessive memory allocation.

Other affected methods are: html.

Example attack vector:

import { jsPDF } from "jspdf" 

// malicious GIF image data with large width/height headers
const payload = ...

const doc = new jsPDF();

doc.addImage(payload, "GIF", 0, 0, 100, 100);
Patches

The vulnerability has been fixed in jsPDF 4.1.1. Upgrade to jspdf@>=4.2.0.

Workarounds

Sanitize image data or URLs before passing it to the addImage method or one of the other affected methods.

References

https://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25535.md

NVD (es)

jsPDF es una librería para generar PDFs en JavaScript. Anteriormente a la 4.2.0, el control del usuario sobre el primer argumento del método 'addImage' resulta en denegación de servicio. Si se le da la posibilidad de pasar datos de imagen o URLs no saneados al método 'addImage', un usuario puede proporcionar un archivo GIF malicioso que resulta en errores de falta de memoria y denegación de servicio. Los archivos GIF maliciosos tienen entradas de ancho y/o alto grandes en sus cabeceras, lo que lleva a una asignación excesiva de memoria. Otros métodos afectados son: 'html'. La vulnerabilidad ha sido corregida en jsPDF 4.2.0. Como solución alternativa, sanee los datos de imagen o las URLs antes de pasarlos al método addImage o a uno de los otros métodos afectados.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-25535 changed 2026-09-07CVE Terms of Use
GitHub Advisory DatabaseGHSA-67pg-wm7f-q7fj changed 2026-09-10CC-BY-4.0
NVDCVE-2026-25535 changed 2026-08-18Public domain