CVE-2026-24737: jsPDF has a PDF Injection in AcroFormChoiceField which allows Arbitrary JavaScript Execution

Published Feb 2, 2026
·
Updated

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:

js import { jsPDF } from "jspdf" const doc = new jsPDF();

var choiceField = new doc.AcroFormChoiceField(); choiceField.T = "VulnerableField"; choiceField.x = 20; choiceField.y = 20; choiceField.width = 100; choiceField.height = 20;

// PAYLOAD: // 1. Starts with "/" to bypass escaping. // 2. "dummy]" closes the array. // 3. "/AA" injects an Additional Action (Focus event). // 4. "/JS" executes arbitrary JavaScript. const payload = "/dummy] /AA << /Fo << /S /JavaScript /JS (app.alert('XSS')) >> >> /Garbage [";

choiceField.addOption(payload); doc.addField(choiceField);

doc.save("test.pdf");

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ç

Other sources

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.1.0, 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, and AcroFormRadioButton.appearanceState. The vulnerability has been fixed in jsPDF.0.

Red Hat

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.1.0, 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, and AcroFormRadioButton.appearanceState. The vulnerability has been fixed in jsPDF@4.1.0.

NVD

Affected Software

2 affected componentsFixes available
npm/jspdf<=4.0.0
4.1.0
parall jspdf Node.js<4.1.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.1.0
  2. Upgrade

    Upgrade jsPDF to a version that resolves this vulnerability.

    Fixed in 4.1.0
  3. Configuration

    Sanitize any user-controlled value before passing it to jsPDF AcroFormChoiceField.addOption. Ensure input does not start with '/' (since '/' can bypass escaping) to prevent PDF object/JavaScript injection.

    AcroFormChoiceField.addOption input_sanitization = sanitize user input before passing it to AcroformChoiceField.addOption; do not allow input starting with '/' to bypass escaping
  4. Configuration

    Sanitize any user-controlled options before passing them to jsPDF AcroFormChoiceField.setOptions. Ensure input does not start with '/' (since '/' can bypass escaping) to prevent PDF object/JavaScript injection.

    AcroFormChoiceField.setOptions input_sanitization = sanitize user input before passing it to AcroformChoiceField.setOptions; do not allow input starting with '/' to bypass escaping
  5. Configuration

    Sanitize any user-controlled value assigned to jsPDF AcroFormCheckBox.appearanceState. Ensure input does not start with '/' (since '/' can bypass escaping) to prevent PDF object/JavaScript injection.

    AcroFormCheckBox.appearanceState input_sanitization = sanitize user input before passing it to AcroformCheckBox.appearanceState; do not allow input starting with '/' to bypass escaping
  6. Configuration

    Sanitize any user-controlled value assigned to jsPDF AcroFormRadioButton.appearanceState. Ensure input does not start with '/' (since '/' can bypass escaping) to prevent PDF object/JavaScript injection.

    AcroFormRadioButton.appearanceState input_sanitization = sanitize user input before passing it to AcroformRadioButton.appearanceState; do not allow input starting with '/' to bypass escaping

Event History

Feb 2, 2026
Advisory Published
via GitHub·06:29 PM
Data Sourced
via GitHub·06:29 PM
DescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·08:29 PM
Data Sourced
via MITRE·08:29 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:16 PM
RemedyAffected Software
Feb 3, 2026
Data Sourced
via Red Hat·12:02 AM
DescriptionSeverityAffected 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-24737?

CVE-2026-24737 is considered to have a high severity due to the potential for arbitrary PDF object injection.

2

How do I fix CVE-2026-24737?

To fix CVE-2026-24737, upgrade to jspdf version 4.1.0 or later.

3

What software is affected by CVE-2026-24737?

CVE-2026-24737 affects jspdf versions up to 4.0.0 from npm.

4

What type of attacks can CVE-2026-24737 enable?

CVE-2026-24737 can enable attacks that inject malicious JavaScript actions into PDFs.

5

Can CVE-2026-24737 be exploited remotely?

Yes, CVE-2026-24737 can potentially be exploited remotely if an attacker can manipulate unsanitized input.

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