jsPDF
CVE-2026-25535
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify app feeding user images to jsPDF
-
DeliveryCraft GIF with huge width/height header
-
ExploitSubmit image via upload or URL
-
ExecutionaddImage invokes omggif decoder
-
PersistOversized pixel buffer allocation
-
ImpactOut-of-memory crash, denial of service
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK
1 technique across 1 tactic: Impact The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the target application allows attacker influence over the first argument of jsPDF's addImage method (or the html method) - i.e., it passes unsanitized user-supplied image data or URLs into jsPDF rather than only trusted developer-controlled images. The malicious payload must be a GIF whose logical-screen/image-descriptor width and/or height fields are set large enough that width*height exceeds the decoder's allocation capacity (the fix threshold is 512M pixels). What LIMITS exploitation: it is harmless against deployments that render only trusted, fixed images; impact is confined to availability (process crash / OOM) with no data disclosure or code execution; and any input validation that bounds image dimensions or restricts image sources neutralizes it. CVSS reports PR:N/UI:N, so no authentication or victim interaction is inherently required beyond the application-level prerequisite of accepting external image input. |
| Impact | The vendor CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) scoring 8.7 reflects a pure availability impact (VA:H, VC:N/VI:N) - no confidentiality or integrity loss, which is consistent with a memory-exhaustion DoS. The high base score is driven by network reach and no privilege requirement, but real-world risk is gated by an application-level precondition the CVSS abstraction hides: the host application must actually pass attacker-controlled image data or URLs into addImage/html. Applications that only render trusted, developer-supplied images are not exposed. This tension is reflected in the signals: EPSS is very low (0.05%, 17th percentile) and the issue is NOT in CISA KEV, indicating no observed mass exploitation, even though a public POC exists. Net assessment: a genuine and easily-triggered DoS for the subset of deployments that feed untrusted images to jsPDF (e.g., user-uploaded avatars rendered into PDFs), but lower urgency than the 8.7 suggests for the broader install base. No code-execution or data-exposure risk. |
| Exploit ScenarioDerived | An application lets users upload a profile picture that is later embedded into a generated PDF via jsPDF's addImage. An attacker uploads a tiny crafted GIF whose header declares a width/height of tens of thousands of pixels each; when the server (or victim browser) renders the PDF, omggif tries to allocate a multi-gigabyte pixel buffer, exhausts memory, and crashes the process. A public POC is available at https://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25535.md, and the low attack complexity (AC:L) means no special timing or conditions are needed. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv5 – Jun 30, 2026
Denial of service in jsPDF (npm package, all versions prior to 4.2.0) lets an attacker who can supply image input to the addImage or html methods crash the host process. A malicious GIF whose header declares enormous width/height values forces the bundled omggif decoder to attempt allocation of an oversized pixel buffer, producing out-of-memory errors. Publicly available exploit code exists (no active exploitation reported in CISA KEV), and the EPSS probability is low at 0.05%.
Earlier versions of this analysis (4)
Denial of service in jsPDF, a widely used JavaScript client/server-side PDF generation library, affects all versions prior to 4.2.0 when an application passes attacker-controlled image data or URLs to the addImage (or html) method. A maliciously crafted GIF with oversized width/height header values forces excessive memory allocation, triggering out-of-memory errors that crash the Node.js process or browser tab. Publicly available exploit code exists and a vendor patch is released, but EPSS is very low (0.05%, 17th percentile) and the issue is not on CISA KEV.
Denial of service in the jsPDF JavaScript PDF-generation library (versions prior to 4.2.0) lets an attacker who controls the first argument of the addImage method - or the input to the html method - supply a crafted GIF whose header declares enormous width/height values, forcing excessive memory allocation, out-of-memory errors, and process crash. Publicly available exploit code exists, though EPSS is very low (0.05%, 17th percentile) and it is not listed in CISA KEV, indicating no public exploit identified at time of analysis for active campaigns. Impact is availability-only; there is no confidentiality or integrity loss.
Denial of service in jsPDF before 4.2.0 lets attackers trigger out-of-memory crashes by feeding a malicious GIF to the addImage method (and the html method, which calls it internally). The GIF's header declares enormous width and/or height values, forcing jsPDF to attempt excessive memory allocation that exhausts the host process. Publicly available exploit code exists, though EPSS rates real-world exploitation probability very low (0.05%, 17th percentile), and the issue is not on CISA KEV.
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. [CVSS 7.5 HIGH]
RemediationAI
Vendor-released patch: jsPDF 4.2.0 - upgrade the jspdf dependency to >=4.2.0 (release https://github.com/parallax/jsPDF/releases/tag/v4.2.0, fix commit https://github.com/parallax/jsPDF/commit/2e5e156e284d92c7d134bce97e6418756941d5e6, advisory https://github.com/parallax/jsPDF/security/advisories/GHSA-67pg-wm7f-q7fj). Red Hat consumers should apply RHSA-2026:7110 and RHSA-2026:7128. If immediate upgrade is not possible, the vendor-recommended workaround is to sanitize image data and URLs before they reach addImage or html: validate that decoded GIF header width*height stays under a safe ceiling (the patch uses 512MB of pixels) and reject oversized images, and/or restrict addImage to a trusted allowlist of image sources rather than accepting arbitrary user-supplied data or remote URLs. The trade-off of source restriction is reduced functionality for features that legitimately need user-provided images; the trade-off of dimension validation is the need to parse headers yourself, which the upgrade does for you, so upgrading is strongly preferred.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
jsPDF embeds raster images by parsing them with an internal copy of the omggif GIF decoder (src/libs/omggif.js). A GIF logical screen / image descriptor declares width and height fields in its header; the decoder multiplies these to size a pixel buffer before any bounds checking. The root cause maps to CWE-400 (Uncontrolled Resource Consumption): attacker-controlled dimension fields drive an unbounded memory allocation (num_pixels = width * height) with no upper limit. The fix commit (2e5e156) adds two guards that throw 'Image dimensions exceed 512MB' when num_pixels exceeds 512*1024*1024. The affected component is the Node.js distribution of the package per CPE cpe:2.3:a:parall:jspdf:*:*:*:*:*:node.js:*:*, though the GHSA notes the flaw is both client-side and server-side since jsPDF runs in browsers and Node.
Know when Jspdf gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Network-reachable image input with no auth or interaction (AV:N/AC:L/PR:N/UI:N); impact is purely availability via OOM crash, so C:N/I:N/A:H and scope unchanged.
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
8DescriptionCVE.org
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.
Blast Radius
ecosystem impact- 2 npm packages depend on jspdf (2 direct, 0 indirect)
Ecosystem-wide dependent count for version 4.2.0.
Executive ViewAI
jsPDF, a widely deployed open-source PDF generation library, contains a denial-of-service vulnerability (CVSS 8.7) in versions prior to 4.2.0 that allows any user submitting images to crash applications processing those files. Organizations using affected versions face potential service outages if image uploads or user-supplied content are enabled. A vendor patch (4.2.0) is available and should be prioritized given the straightforward exploitation path, despite current EPSS modeling indicating low active exploitation probability.
Apply vendor patch to jsPDF 4.2.0. Until patching is complete, implement input validation to reject images with declared dimensions exceeding 10,000 × 10,000 pixels to block the out-of-memory trigger mechanism.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Affected Products (CPE)CVE.org
PDF object injection in the jsPDF JavaScript library (npm package 'jspdf', versions prior to 4.2.0) lets an attacker who
PDF generation in jsPDF prior to version 4.1.0 allows injection of arbitrary PDF objects through unsanitized input passe
Denial of service in jsPDF prior to version 4.1.0 occurs when malicious BMP files with oversized dimension headers are p
In all versions of the package jspdf, it is possible to use <<script>script> in order to go over the filtering regex. Ra
All affected versions <2.0.0 of package jspdf are vulnerable to Cross-site Scripting (XSS). Rated medium severity (CVSS
Jspdf versions up to 4.1.0 contains a vulnerability that allows attackers to inject arbitrary XML (CVSS 5.4).
Local file inclusion and path traversal in the Node.js builds of jsPDF (dist/jspdf.node.js and dist/jspdf.node.min.js) p
jsPDF versions prior to 4.1.0 contain a race condition in the addJS method where a shared module-scoped variable is over
jsPDF versions prior to 4.2.0 allow attackers to inject arbitrary PDF objects including malicious JavaScript through uns
This affects the package jspdf before 2.3.1. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable,
jsPDF is a library to generate PDFs in JavaScript. Rated high severity (CVSS 8.7), this vulnerability is remotely exploi
jsPDF is a library to generate PDFs in JavaScript. Rated high severity (CVSS 8.7), this vulnerability is remotely exploi
GHSA-67pg-wm7f-q7fj
NVD
CVE.org
EPSS
VulDB
Exploit-DB