CVE-2026-25940: jsPDF's PDF Injection in AcroForm module allows Arbitrary JavaScript Execution (RadioButton.createOption and "AS" property)

Published Feb 19, 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 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:

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

const group = new doc.AcroFormRadioButton(); group.x = 10; group.y = 10; group.width = 20; group.height = 10; doc.addField(group);

const child = group.createOption("opt1"); child.x = 10; child.y = 10; child.width = 20; child.height = 10; child.appearanceState = "Off /AA << /E << /S /JavaScript /JS (app.alert('XSS')) >> >>";

doc.save("test.pdf");

Patches

The vulnerability has been fixed in jsPDF@4.2.0.

Workarounds Sanitize user input before passing it to the vulnerable API members.

Other sources

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.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 property, a user can inject arbitrary PDF objects, such as JavaScript actions, which are executed when the victim hovers over the radio option. The vulnerability has been fixed in jsPDF.0. As a workaround, sanitize user input before passing it to the vulnerable API members.

Red Hat

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.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 property, a user can inject arbitrary PDF objects, such as JavaScript actions, which are executed when the victim hovers over the radio option. The vulnerability has been fixed in jsPDF@4.2.0. As a workaround, sanitize user input before passing it to the vulnerable API members.

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

    Sanitize/validate any user input before assigning it to vulnerable AcroForm module properties/methods (including AcroformChildClass.appearanceState and other user-controlled AcroForm radio option properties) to prevent injection of arbitrary PDF objects (e.g., JavaScript actions).

    jsPDF AcroForm (AcroFormRadioButton / RadioButton.createOption / AcroformChildClass.appearanceState) user-supplied inputs to AcroformChildClass.appearanceState (and related properties/methods that can be set by user) = sanitized before use

Event History

Feb 19, 2026
CVE Published
via MITRE·03:26 PM
Data Sourced
via MITRE·03:26 PM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·04:04 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·04:27 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-25940?

The severity of CVE-2026-25940 is considered high due to the potential for arbitrary code injection in PDF documents.

2

How do I fix CVE-2026-25940?

To fix CVE-2026-25940, update jsPDF to version 4.2.0 or later which addresses the vulnerability.

3

What does CVE-2026-25940 affect?

CVE-2026-25940 affects versions of jsPDF prior to 4.2.0 used for generating PDFs in JavaScript.

4

What types of attacks can be executed due to CVE-2026-25940?

CVE-2026-25940 allows attackers to inject arbitrary PDF objects, such as malicious JavaScript actions, which can lead to data theft or further exploitation.

5

Who is affected by CVE-2026-25940?

Developers using versions of jsPDF below 4.2.0 in their web applications are potentially affected by CVE-2026-25940.

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