CVE-2026-25755: jsPDF has PDF Object Injection via Unsanitized Input in addJS Method

Published Feb 19, 2026
·
Updated

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.

js import { jsPDF } from "jspdf"; const doc = new jsPDF(); // Payload: // 1. ) closes the JS string. // 2. > closes the current dictionary. // 3. /AA ... injects an "Additional Action" that executes on focus/open. const maliciousPayload = "console.log('test');) >> /AA << /O << /S /JavaScript /JS (app.alert('Hacked!')) >> >>";

doc.addJS(maliciousPayload); doc.save("vulnerable.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

Other sources

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.0, 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. The vulnerability has been fixed in jspdf.0. As a workaround, escape parentheses in user-provided JavaScript code before passing them to the addJS method.

Red Hat

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.0, 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. The vulnerability has been fixed in jspdf@4.2.0. As a workaround, escape parentheses in user-provided JavaScript code before passing them to the addJS method.

NVD

Affected Software

3 affected componentsFixes available
npm/jspdf<4.2.0
npm/jspdf<4.2.0
4.2.0
parall jspdf Node.js<4.2.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/jspdf to a version that resolves this vulnerability.

    Fixed in 4.2.0
  2. Upgrade

    Upgrade jspdf to a version that resolves this vulnerability.

    Fixed in 4.2.0
  3. Configuration

    As a workaround, escape parentheses in user-provided JavaScript code before passing it to the jsPDF addJS method.

    jsPDF (addJS) user_provided_js_input = escape_parens

Event History

Feb 19, 2026
CVE Published
via MITRE·02:41 PM
Data Sourced
via MITRE·02:41 PM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·03:01 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·03:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Advisory Published
via GitHub·07:32 PM
Data Sourced
via GitHub·07:32 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-25755?

CVE-2026-25755 is classified as a high severity vulnerability due to the potential for PDF Object Injection.

2

How do I fix CVE-2026-25755?

To fix CVE-2026-25755, upgrade to jsPDF version 4.2.0 or later, which addresses the issue.

3

What are the exploitation risks of CVE-2026-25755?

Exploitation of CVE-2026-25755 can allow attackers to inject arbitrary PDF objects, potentially leading to information disclosure or further attacks.

4

Which versions of jsPDF are affected by CVE-2026-25755?

CVE-2026-25755 affects all versions of jsPDF prior to 4.2.0.

5

What is the main vulnerability in CVE-2026-25755?

The main vulnerability in CVE-2026-25755 is unsanitized input in the addJS method, allowing for PDF Object Injection.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203