CVE-2026-24133
JSON

8.7high

jsPDF Affected by Denial of Service (DoS) via Unvalidated BMP Dimensions in BMPDecoder

Severity
8.7high CVSS:4.0 by GitHub_M
Exploit likelihood
0.62% (higher than 50% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-95fx-jjr5-f39c

Description

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.1.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 BMP file that results in out of memory errors and denial of service. Harmful BMP files have large width and/or height entries in their headers, which lead to excessive memory allocation. The html method is also affected. The vulnerability has been fixed in jsPDF@4.1.0.

Affected

Product or packageVersionsReported by
parallax jsPDF< 4.1.0CVE List
jspdf (npm)before 4.1.0GitHub Advisory Database
parall jspdfbefore 4.1.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
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
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-20CWE-400CWE-770

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.1.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 BMP file that results in out of memory errors and denial of service. Harmful BMP files have large width and/or height entries in their headers, which lead to excessive memory allocation. The html method is also affected. The vulnerability has been fixed in jsPDF@4.1.0.

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 BMP file that results in out of memory errors and denial of service. Harmful BMP 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 BMP image data with large width/height headers
const payload = ...

const doc = new jsPDF();

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

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

Workarounds

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

NVD (es)

jsPDF es una biblioteca para generar PDFs en JavaScript. Anterior a la 4.1.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 BMP malicioso que resulta en errores de falta de memoria y denegación de servicio. Los archivos BMP maliciosos tienen entradas grandes de ancho y/o alto en sus cabeceras, lo que lleva a una asignación de memoria excesiva. El método html también se ve afectado. La vulnerabilidad ha sido corregida en jsPDF@4.1.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-24133 changed 2026-02-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-95fx-jjr5-f39c changed 2026-09-10CC-BY-4.0
NVDCVE-2026-24133 changed 2026-06-17Public domain