Skip to content

← Public intelligence

npm package

jspdf

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

15 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Critical, CVSS 9.6npmAmendedPublished

    jsPDF has HTML Injection in New Window paths

    CVE-2026-31938 · GHSA-wfv2-pwc8-crg5

    Affected
    • npm jspdf <= 4.2.0
    Fixed in
    4.2.1· Vendor fix available
    Issue
    Impact User control of the options argument of the output function allows attackers to inject arbitrary HTML (such as scripts) into the browser context the created PDF is opened in. The affected overloads and options are: "pdfobjectnewwindow": the pdfObjectUrl option and the entire options object, which is JSON-serialized and included verbatim in the generated HTML-string. "pdfjsnewwindow": the pdfJsUrl and filename options "dataurlnewwindow": the filename option The vulnerability can be exploited in the following scenario: the attacker provides values for the output options, for example via a web interface. These values are then passed unsanitized (automatically or semi-automatically) to the attack victim. The victim creates and opens a PDF with the attack vector using one of the vulnerable method overloads inside their browser. The attacker can thus inject scripts that run in the victims browser context and can extract or modify secrets from this context. Example attack vector:…

    Recommended action: Upgrade to 4.2.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.com (1)osv.dev (2)Source checked Evidence →
  2. High, CVSS 8.1npmAmendedPublished

    jsPDF has a PDF Object Injection via FreeText color

    CVE-2026-31898 · GHSA-7x6v-j9x4-qf24

    Affected
    • npm jspdf <= 4.2.0
    Fixed in
    4.2.1· Vendor fix available
    Issue
    Impact User control of arguments of the createAnnotation method allows users to inject arbitrary PDF objects, such as JavaScript actions. If given the possibility to pass unsanitized input to the following method, a user can inject arbitrary PDF objects, such as JavaScript actions, which might trigger when the PDF is opened or interacted with.. createAnnotation: color parameter Example attack vector: Patches The vulnerability has been fixed in jsPDF@4.2.1. Workarounds Sanitize user input before passing it to the vulnerable API members.

    Recommended action: Upgrade to 4.2.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  3. High, CVSS 8.1npmAmendedPublished

    jsPDF has a PDF Injection in AcroForm module allows Arbitrary JavaScript Execution (RadioButton.createOption and "AS" property)

    CVE-2026-25940 · GHSA-p5xg-68wr-hm3m

    Affected
    • npm jspdf < 4.2.0
    Fixed in
    4.2.0· Vendor fix available
    Issue
    Impact User control of properties and methods of the Acroform module allows users to inject arbitrary PDF objects, such as JavaScript actions. If given the possibility to pass unsanitized input to the following property, a user can inject arbitrary PDF objects, such as JavaScript actions, which are executed when the victim hovers over the radio option. AcroformChildClass.appearanceState Example attack vector: Patches The vulnerability has been fixed in jsPDF@4.2.0. Workarounds Sanitize user input before passing it to the vulnerable API members.

    Recommended action: Upgrade to 4.2.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  4. High, CVSS 8.1npmAmendedPublished

    jsPDF has a PDF Object Injection via Unsanitized Input in addJS Method

    CVE-2026-25755 · GHSA-9vjf-qc39-jprp

    Affected
    • npm jspdf < 4.2.0
    Fixed in
    4.2.0· Vendor fix available
    Issue
    Impact User control of the argument of the addJS method allows an attacker to inject arbitrary PDF objects into the generated document. By crafting a payload that escapes the JavaScript string delimiter, an attacker can execute malicious actions or alter the document structure, impacting any user who opens the generated PDF. Patches The vulnerability has been fixed in jspdf@4.2.0. Workarounds Escape parentheses in user-provided JavaScript code before passing them to the addJS method. References https://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25755.md

    Recommended action: Upgrade to 4.2.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  5. High, CVSS 8.7npmAmendedPublished

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

    CVE-2026-25535 · GHSA-67pg-wm7f-q7fj

    Affected
    • npm jspdf < 4.2.0
    Fixed in
    4.2.0· Vendor fix available
    Issue
    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: 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

    Recommended action: Upgrade to 4.2.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  6. High, CVSS 8.1npmAmendedPublished

    jsPDF has PDF Injection in AcroFormChoiceField that allows Arbitrary JavaScript Execution

    CVE-2026-24737 · GHSA-pqxr-3g65-p328

    Affected
    • npm jspdf <= 4.0.0
    Fixed in
    4.1.0· Vendor fix available
    Issue
    Impact User control of properties and methods of the Acroform module allows users to inject arbitrary PDF objects, such as JavaScript actions. If given the possibility to pass unsanitized input to one of the following methods or properties, a user can inject arbitrary PDF objects, such as JavaScript actions, which are executed when the victim opens the document. The vulnerable API members are: AcroformChoiceField.addOption AcroformChoiceField.setOptions AcroFormCheckBox.appearanceState AcroFormRadioButton.appearanceState Example attack vector: Patches The vulnerability has been fixed in jsPDF@4.1.0. Workarounds Sanitize user input before passing it to the vulnerable API members. Credits Research and fix: Ahmet Artuç

    Recommended action: Upgrade to 4.1.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  7. High, CVSS 8.7npmAmendedPublished

    jsPDF Vulnerable to Denial of Service (DoS) via Unvalidated BMP Dimensions in BMPDecoder

    CVE-2026-24133 · GHSA-95fx-jjr5-f39c

    Affected
    • npm jspdf <= 4.0.0
    Fixed in
    4.1.0· Vendor fix available
    Issue
    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 BMP file that results in out of memory errors and denial of service. Harmful BMP 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: Patches The vulnerability has been fixed in jsPDF 4.1.0. Upgrade to jspdf@=4.1.0. Workarounds Sanitize image data or URLs before passing it to the addImage method or one of the other affected methods.

    Recommended action: Upgrade to 4.1.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  8. Medium, CVSS 6.9npmAmendedPublished

    jsPDF Vulnerable to Stored XMP Metadata Injection (Spoofing & Integrity Violation)

    CVE-2026-24043 · GHSA-vm32-vv63-w422

    Affected
    • npm jspdf <= 4.0.0
    Fixed in
    4.1.0· Vendor fix available
    Issue
    Impact User control of the first argument of the addMetadata function allows users to inject arbitrary XML. If given the possibility to pass unsanitized input to the addMetadata method, a user can inject arbitrary XMP metadata into the generated PDF. If the generated PDF is signed, stored or otherwise processed after, the integrity of the PDF can no longer be guaranteed. Example attack vector: Patches The vulnerability has been fixed in jsPDF@4.1.0 Workarounds Sanitize user input before passing it to the addMetadata method: escape XML entities. For example:

    Recommended action: Upgrade to 4.1.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  9. Medium, CVSS 6.3npmAmendedPublished

    jsPDF has Shared State Race Condition in addJS Plugin

    CVE-2026-24040 · GHSA-cjw8-79x6-5cj4

    Affected
    • npm jspdf <= 4.0.0
    Fixed in
    4.1.0· Vendor fix available
    Issue
    Impact The addJS method in the jspdf Node.js build utilizes a shared module-scoped variable (text) to store JavaScript content. When used in a concurrent environment (e.g., a Node.js web server), this variable is shared across all requests. If multiple requests generate PDFs simultaneously, the JavaScript content intended for one user may be overwritten by a subsequent request before the document is generated. This results in Cross-User Data Leakage, where the PDF generated for User A contains the JavaScript payload (and any embedded sensitive data) intended for User B. Typically, this only affects server-side environments, although the same race conditions might occur if jsPDF runs client-side. Patches The vulnerability has been fixed in jspdf@4.0.1. The fix moves the shared variable into the function scope, ensuring isolation between instances. Workarounds Avoid using the addJS method in concurrent server-side environments. If usage is required, ensure requests are processed…

    Recommended action: Upgrade to 4.1.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  10. Critical, CVSS 9.2npmAmendedPublished

    jsPDF has Local File Inclusion/Path Traversal vulnerability

    CVE-2025-68428 · GHSA-f8cm-6447-x5h2

    Affected
    • npm jspdf <= 3.0.4
    Fixed in
    4.0.0· Vendor fix available
    Issue
    Impact User control of the first argument of the loadFile method in the node.js build allows local file inclusion/path traversal. If given the possibility to pass unsanitized paths to the loadFile method, a user can retrieve file contents of arbitrary files in the local file system the node process is running in. The file contents are included verbatim in the generated PDFs. Other affected methods are: addImage, html, addFont. Only the node.js builds of the library are affected, namely the dist/jspdf.node.js and dist/jspdf.node.min.js files. Example attack vector: Patches The vulnerability has been fixed in jsPDF@4.0.0. This version restricts file system access per default. This semver-major update does not introduce other breaking changes. Workarounds With recent node versions, jsPDF recommends using the --permission flag in production. The feature was introduced experimentally in v20.0.0 and is stable since v22.13.0/v23.5.0/v24.0.0. See the node documentation for details. For older…

    Recommended action: Upgrade to 4.0.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.com (1)osv.dev (2)Source checked Evidence →
  11. High, CVSS 8.7npmAmendedPublished

    jsPDF Denial of Service (DoS)

    CVE-2025-57810 · GHSA-8mvj-3j78-4qmw

    Affected
    • npm jspdf <= 3.0.1
    Fixed in
    3.0.2· Vendor fix available
    Issue
    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 data or URLs to the addImage method, a user can provide a harmful PNG file that results in high CPU utilization and denial of service. Other affected methods are: html. Example payload: Patches The vulnerability was fixed in jsPDF 3.0.2. Upgrade to jspdf@=3.0.2. In jspdf@=3.0.2, invalid PNG files throw an Error instead of causing very long running loops. Workarounds Sanitize image data or URLs before passing it to the addImage method or one of the other affected methods. Credits Researcher: Aleksey Solovev (Positive Technologies)

    Recommended action: Upgrade to 3.0.2 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  12. High, CVSS 8.7npmAmendedPublished

    jsPDF Bypass Regular Expression Denial of Service (ReDoS)

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

    Affected
    • npm jspdf < 3.0.1
    Fixed in
    3.0.1· Vendor fix available
    Issue
    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: Patches The vulnerability was fixed in jsPDF 3.0.1. Upgrade to jspdf@=3.0.1 Workarounds Sanitize image urls before passing it to the addImage method or one of the other affected methods. Credits Researcher: Aleksey Solovev (Positive Technologies)

    Recommended action: Upgrade to 3.0.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  13. Medium, CVSS 6.1npmAmendedPublished

    Cross-site scripting in jspdf

    CVE-2020-7690 · GHSA-vh59-v9r5-4mh4

    Affected
    • npm jspdf < 2.0.0
    Fixed in
    2.0.0· Vendor fix available
    Issue
    Affected versions of this package are vulnerable to Cross-site Scripting (XSS). It's possible to inject JavaScript code via the html method.

    Recommended action: Upgrade to 2.0.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  14. Medium, CVSS 6.1npmAmendedPublished

    Cross-site scripting in jspdf

    CVE-2020-7691 · GHSA-3q6f-8grx-pr4v

    Affected
    • npm jspdf < 2.0.0
    Fixed in
    2.0.0· Vendor fix available
    Issue
    It's possible to use nested script tags in order to bypass the filtering regex.

    Recommended action: Upgrade to 2.0.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  15. High, CVSS 7.5npmAmendedPublished

    jspdf vulnerable to Regular Expression Denial of Service (ReDoS)

    CVE-2021-23353 · GHSA-57f3-gghm-9mhc

    Affected
    • npm jspdf < 2.3.1
    Fixed in
    2.3.1· Vendor fix available
    Issue
    This affects the package jspdf before 2.3.1. ReDoS is possible via the addImage function.

    Recommended action: Upgrade to 2.3.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →