VYPR
High severityNVD Advisory· Published Feb 19, 2026· Updated Feb 19, 2026

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

CVE-2026-25535

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 packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
jspdfnpm
< 4.2.04.2.0

Affected products

1

Patches

1
2e5e156e284d

Merge commit from fork

https://github.com/parallax/jsPDFLukas HolländerFeb 19, 2026via ghsa
1 file changed · +10 0
  • src/libs/omggif.js+10 0 modified
    @@ -610,6 +610,11 @@ function GifReader(buf) {
       this.decodeAndBlitFrameBGRA = function(frame_num, pixels) {
         var frame = this.frameInfo(frame_num);
         var num_pixels = frame.width * frame.height;
    +
    +    if (num_pixels > 512 * 1024 * 1024) {
    +      throw new Error("Image dimensions exceed 512MB, which is too large.");
    +    }
    +
         var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices.
         GifReaderLZWOutputIndexStream(
           buf,
    @@ -682,6 +687,11 @@ function GifReader(buf) {
       this.decodeAndBlitFrameRGBA = function(frame_num, pixels) {
         var frame = this.frameInfo(frame_num);
         var num_pixels = frame.width * frame.height;
    +
    +    if (num_pixels > 512 * 1024 * 1024) {
    +      throw new Error("Image dimensions exceed 512MB, which is too large.");
    +    }
    +
         var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices.
         GifReaderLZWOutputIndexStream(
           buf,
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.