8.1high
jsPDF has a PDF Injection in AcroFormChoiceField which allows Arbitrary JavaScript Execution
- Severity
- 8.1high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.71% (higher than 49% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-pqxr-3g65-p328
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| parallax jsPDF | < 4.1.0 | CVE List |
| advanced-cluster-security/rhacs-main-rhel8 | Not specified Not affected: from 1773235880 before *, from 1773235860 before * | CVE List |
| advanced-cluster-security/rhacs-central-db-rhel8 | Not specified | CVE List |
| advanced-cluster-security/rhacs-rhel8-operator | Not specified | CVE List |
| advanced-cluster-security/rhacs-roxctl-rhel8 | Not specified | CVE List |
| advanced-cluster-security/rhacs-scanner-v4-db-rhel8 | Not specified | CVE List |
| advanced-cluster-security/rhacs-scanner-v4-rhel8 | Not specified | CVE List |
| jspdf (npm) | before 4.1.0 | GitHub Advisory Database |
| parall jspdf | before 4.1.0 | NVD |
All scores
| GitHub_M | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N |
| redhat-SADP | 8.3high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L |
| GitHub | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.addOptionAcroformChoiceField.setOptionsAcroFormCheckBox.appearanceStateAcroFormRadioButton.appearanceState
Example attack vector:
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ç
NVD (es)
jsPDF es una biblioteca para generar PDFs en JavaScript. Antes de 4.1.0, el control del usuario sobre las propiedades y métodos del módulo Acroform permite a los usuarios inyectar objetos PDF arbitrarios, como acciones JavaScript. Si se da la posibilidad de pasar entrada no saneada a uno de los siguientes métodos o propiedades, un usuario puede inyectar objetos PDF arbitrarios, como acciones JavaScript, que se ejecutan cuando la víctima abre el documento. Los miembros de la API vulnerables son AcroformChoiceField.addOption, AcroformChoiceField.setOptions, AcroFormCheckBox.appearanceState y AcroFormRadioButton.appearanceState. La vulnerabilidad ha sido corregida en jsPDF@4.1.0.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-24737 changed 2026-08-18 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-pqxr-3g65-p328 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-24737 changed 2026-08-18 | Public domain |