GitHub Advisoryadvisory · npm

GHSA-p5xg-68wr-hm3m jsPDF has a PDF Injection in AcroForm module allows Arbitrary JavaScript Execution (RadioButton.createOption and "AS" property)

HIGH Published 2026-02-19 Modified 2026-03-11 Official page ↗
Aliases
CVE-2026-25940
Ecosystem
npm
Packages
jspdf
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Weaknesses
CWE-116
Reviewed
2026-02-19

Affected packages

• npm jspdf: < 4.2.0 → fixed in 4.2.0

Description

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 > >>"; doc.save("test.pdf"); ``` Patches The vulnerability has been fixed in [email protected]. Workarounds Sanitize user input before passing it to the vulnerable API members.

Related

Alias · CVE (1)

  • CVE-2026-25940 jsPDF is a library to generate PDFs in JavaScript. vulnerability

Weakness · CWE (1)

  • CWE-116 Improper Encoding or Escaping of Output weakness

References