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 package | Versions | Reported by |
|---|---|---|
| parallax jsPDF | < 4.2.0 | CVE List |
| advanced-cluster-security/rhacs-main-rhel8 | Not specified Not affected: from 1775594119 before *, from 1775594284 before * | CVE List |
| jspdf (npm) | before 4.2.0 | GitHub Advisory Database |
| parall jspdf | before 4.2.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 |
| redhat-SADP | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| 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 | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/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.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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-25535 changed 2026-09-07 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-67pg-wm7f-q7fj changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-25535 changed 2026-08-18 | Public domain |