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 package | Versions | Reported by |
|---|---|---|
| parallax jsPDF | < 4.1.0 | CVE List |
| jspdf (npm) | before 4.1.0 | GitHub Advisory Database |
| parall jspdf | before 4.1.0 | NVD |
All scores
| GitHub_M | 8.7high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| NVD | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Classification
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
| https://github.com/parallax/jsPDF/security/advisories/GHSA-95fx-jjr5-f39c | exploit, vendor-advisory, web | |
| https://github.com/parallax/jsPDF/commit/ae4b93f76d8fc1baa5614bd5fdb5d174c3b85f0d | patch, web | |
| https://github.com/parallax/jsPDF/releases/tag/v4.1.0 | release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-24133 | advisory | |
| https://github.com/parallax/jsPDF | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-24133 changed 2026-02-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-95fx-jjr5-f39c changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-24133 changed 2026-06-17 | Public domain |