CVE-2026-25535: Jspdf Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-67pg-wm7f-q7fj
CWE-770
Published
Advisory Summary

CVE-2026-25535 is a HIGH denial of service vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Jspdf libraries in the npm ecosystem. The issue involves jspdf affected by client-side/server-side denial of service via malicious gif dimensions. Remediation is available by upgrading affected packages to version 4.2.0.

CVE-2026-25535 at a Glance

CVE Identifier CVE-2026-25535
GHSA Identifier GHSA-67pg-wm7f-q7fj
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product Jspdf
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-25535

To remediate this vulnerability, upgrade all affected Jspdf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

jspdf fixed: 4.2.0
npm install jspdf@4.2.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls jspdf

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-25535, inspect your project dependencies using npm:

npm ls jspdf

Analyze the terminal output to locate any version of Jspdf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.2.0), your application is affected.

Note: The npm ls jspdf command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Jspdf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: ```js 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

CVE-2026-25535 Affected Jspdf Versions

1 component(s)
Fixed Versions:
4.2.0
Product / Package Ecosystem Affected Versions Fixed Version
jspdf
npm
< 4.2.0
4.2.0

References

Frequently Asked Questions

What is CVE-2026-25535?
CVE-2026-25535 is a security vulnerability in Jspdf involving jsPDF Affected by Client-Side/Server-Side Denial of Service via Malicious GIF Dimensions under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Jspdf versions are affected?
Affected versions include releases prior to 4.2.0 across affected packages: jspdf.
What version fixes CVE-2026-25535?
Upgrading to 4.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jspdf affected?
Yes, jspdf is affected in releases prior to 4.2.0. Upgrade your dependency to 4.2.0 or later.
What CWE is associated with CVE-2026-25535?
CVE-2026-25535 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check npm dependencies for CVE-2026-25535?
Run the dependency tree command: 'npm ls jspdf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-67pg-wm7f-q7fj",
  "modified" : "2026-02-19T20:58:08Z",
  "published" : "2026-02-19T15:25:48Z",
  "aliases" : [ "CVE-2026-25535" ],
  "summary" : "jsPDF Affected by Client-Side/Server-Side Denial of Service via Malicious GIF Dimensions",
  "details" : "### Impact\n\nUser control of the first argument of the `addImage` method results in denial of service.\n\nIf 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.\n\nOther affected methods are: `html`.\n\nExample attack vector:\n\n```js\nimport { jsPDF } from \"jspdf\" \n\n// malicious GIF image data with large width/height headers\nconst payload = ...\n\nconst doc = new jsPDF();\n\ndoc.addImage(payload, \"GIF\", 0, 0, 100, 100);\n```\n\n### Patches\n\nThe vulnerability has been fixed in jsPDF 4.1.1. Upgrade to jspdf@>=4.2.0.\n\n### Workarounds\n\nSanitize image data or URLs before passing it to the addImage method or one of the other affected methods.\n### References\nhttps://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25535.md",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jspdf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/parallax/jsPDF/security/advisories/GHSA-67pg-wm7f-q7fj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-25535"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/parallax/jsPDF/commit/2e5e156e284d92c7d134bce97e6418756941d5e6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25535.md"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/parallax/jsPDF"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/parallax/jsPDF/releases/tag/v4.2.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-19T15:25:48Z",
    "nvd_published_at" : "2026-02-19T15:16:12Z"
  }
}