# CVE-2025-29907: jsPDF ReDoS via malformed image URL in addImage

Source: https://junglewise.ai/threats/cve-2025-29907-jspdf-redos-via-malformed-image-url-in-addimage  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-03-18. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2025-29907 · Severity: medium · CVSS 4 · Published 2025-03-18

jsPDF is a popular JavaScript library used to generate PDF documents in web applications. A regular expression denial-of-service (ReDoS) vulnerability in image URL parsing allows attackers to cause excessive CPU consumption and application hangs by providing malformed data URLs to the addImage, html, or addSvgAsImage methods. This can disrupt service availability for all users of an application relying on these functions.

Technologies: [jspdf (npm)](https://junglewise.ai/threats/technologies/jspdf). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2025-29907 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-29907 being exploited in the wild.

**How severe is CVE-2025-29907?** Medium severity, with a CVSS score of 4, published 18 March 2025.

**Which products and versions are affected?** jspdf (npm) SEMVER:introduced=0,fixed=3.0.1.

**Is there a fix for CVE-2025-29907?** Yes. jspdf (npm): upgrade to 3.0.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-29907 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2025-29907?** Check whether you run jspdf (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- jspdf (npm): upgrade to 3.0.1 or later

  ```sh
  npm install jspdf@3.0.1
  ```


## Technical details

The vulnerability is a regular expression denial-of-service (ReDoS) affecting jsPDF versions up to 3.0.0. It exists in the image URL parsing logic used by the addImage, html, and addSvgAsImage methods. When these methods receive user-controlled input containing a crafted data URL with a repetitive charset pattern (e.g., 'data:/charset=s' repeated multiple times), the vulnerable regex enters catastrophic backtracking, causing extreme CPU utilization and application hang. No authentication or user interaction is required; an attacker only needs network access to send a malicious image URL to an application using vulnerable jsPDF. The fix was released in jsPDF 3.0.1.

## Affected products

- parallax jsPDF <=3.0.0

## Identifiers

- CVE-2025-29907
- GHSA-w532-jxjh-hjhj

## Timeline

- 2025-03-18: disclosed: Vulnerability published
- 2025-03-18: patched: Fix released in jsPDF 3.0.1

## References

- [https://github.com/parallax/jsPDF/security/advisories/GHSA-w532-jxjh-hjhj](https://github.com/parallax/jsPDF/security/advisories/GHSA-w532-jxjh-hjhj)

## Related threats

- [parallax jsPDF XSS in output function options](https://junglewise.ai/threats/cve-2026-31938-parallax-jspdf-xss-in-output-function-options)
- [parallax jsPDF PDF object injection in createAnnotation](https://junglewise.ai/threats/cve-2026-31898-parallax-jspdf-pdf-object-injection-in-createannotation)
- [parallax jsPDF PDF injection in Acroform module](https://junglewise.ai/threats/cve-2026-25940-parallax-jspdf-pdf-injection-in-acroform-module)
- [parallax jsPDF PDF object injection in addJS method](https://junglewise.ai/threats/cve-2026-25755-parallax-jspdf-pdf-object-injection-in-addjs-method)
- [parallax jsPDF denial of service in addImage method](https://junglewise.ai/threats/cve-2026-25535-parallax-jspdf-denial-of-service-in-addimage-method)
