/

CVE-2026-24737

Severity:

HIGH RISK

(8.1)

Improper Output Neutralization / Injection in jsPDF

CVE-2026-24737

Modified

Vulnerability type

Category:

Improper Output Neutralization / Injection

CWE:

CWE-116, CWE-917

Impact:

Arbitrary PDF Object / Script Injection on Document Open

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

jsPDF's Acroform module previously allowed untrusted values to flow directly into low-level PDF object streams without proper neutralization.

An attacker who can supply unsanitized input to specific Acroform field APIs may inject arbitrary PDF objects (including JavaScript actions) that execute when a victim opens the generated PDF.

Affected context

This vulnerability affects applications that use jsPDF's Acroform module to generate interactive PDF forms and expose Acroform configuration to end users or other untrusted sources.

The risk is most significant where application logic passes user-controlled strings directly into:

  • AcroformChoiceField.addOption
  • AcroformChoiceField.setOptions
  • AcroFormCheckBox.appearanceState
  • AcroFormRadioButton.appearanceState

without validation, escaping, or constraining the allowed values.

Exploit preconditions

  • Attack surface: PDF generation layer in applications using jsPDF Acroform features.
  • Required access: Ability to influence or control data passed into the vulnerable Acroform APIs (e.g., form builders, admin panels, template editors, or any user-supplied configuration).
  • Trigger point: Victim opens the crafted PDF in a PDF viewer that supports embedded JavaScript or respects the injected PDF objects.
  • Why exploitation is possible: The library treated certain Acroform values as trusted and embedded them into the PDF structure without proper neutralization or structural validation, allowing attacker-crafted content to break out of the expected data context and introduce arbitrary PDF objects such as JavaScript actions.

Why this happens

The core issue is an improper output neutralization pattern: jsPDF's Acroform APIs allowed caller-provided values to be written directly into the PDF's internal object representation without enforcing a safe subset or performing escaping/encoding appropriate to the PDF syntax.

In terms of CWE-116, data that should have been treated strictly as content (e.g., choice option labels or appearance states) was instead inserted into a context where PDF object syntax and action definitions are interpreted.

This lack of contextual encoding and structural validation means an attacker can craft strings that alter the PDF object graph, attach additional objects, or reference JavaScript actions, turning benign configuration points into injection sinks.

Potential impact

  • Attacker-controlled JavaScript execution when the victim opens the generated PDF (depending on viewer capabilities and security settings).
  • Injection of arbitrary PDF objects, potentially altering document behavior, navigation, or embedded actions.
  • Social engineering scenarios where a seemingly legitimate PDF performs unexpected actions (e.g., opening URLs, interacting with forms, or manipulating the viewing environment).
  • Potential bypass of upstream input validation if that validation assumes the values are used purely as display text rather than as part of a structured PDF object model.

General mitigation guidance

Effective mitigation focuses on treating all Acroform configuration values as untrusted unless they originate from hard-coded or strictly controlled sources.

Recommended defensive patterns include:

  • Strict whitelisting: Constrain values for appearanceState and option lists to a predefined, application-controlled set of allowed tokens rather than accepting free-form strings.
  • Context-aware encoding: When dynamic data must be used, apply encoding or escaping that is tailored to the PDF syntax and prevents breaking out of the intended data context.
  • Separation of data and structure: Keep structural aspects of the PDF (object definitions, actions, references) fully under application or library control; allow users to influence only plain-text content or identifiers that cannot change the document structure.
  • Input validation at boundaries: Validate and normalize data as early as possible (e.g., at HTTP/API boundaries or UI layers) so that only well-formed, expected values reach the PDF generation layer.
  • Principle of least capability for user input: Avoid exposing low-level configuration options of jsPDF Acroform to untrusted users; provide higher-level abstractions that internally enforce safe defaults and disallow direct injection of raw object content.

How teams detect issues like this

Organizations can detect this class of issue by focusing on where user-controlled data flows into PDF generation code and, specifically, into Acroform APIs:

  • Static analysis patterns:
  • Identify calls to AcroformChoiceField.addOption, AcroformChoiceField.setOptions, AcroFormCheckBox.appearanceState, and AcroFormRadioButton.appearanceState.
  • Flag instances where arguments are derived from HTTP request parameters, query strings, JSON bodies, or other user-controllable sources without intermediate validation or encoding.
  • Code review signals:
  • Direct passing of UI/editor content into PDF configuration.
  • Helper methods or wrapper components that expose "raw" Acroform configuration to external callers.
  • Lack of clear validation or whitelisting for appearance states and option values.
  • Policy enforcement:
  • Introduce secure coding guidelines that require PDF-generating code to treat all dynamic values as untrusted.
  • Use automated code review tools or linters that enforce checks on PDF and document-generation libraries, ensuring proper neutralization steps are present.

Sources

SourceLink
github.comgithub.com/parallax/jsPDF/commit/da291a5f01b96282545c9391996702cdb8879f79
github.comgithub.com/parallax/jsPDF/releases/tag/v4.1.0
github.comgithub.com/parallax/jsPDF/security/advisories/GHSA-pqxr-3g65-p328
access.redhat.comaccess.redhat.com/errata/RHSA-2026:4466
access.redhat.comaccess.redhat.com/errata/RHSA-2026:4467
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-24737
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2436115
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-24737.json

Frequently asked

questions

Yes, in scenarios where an attacker can supply data that an application later uses to build PDFs via vulnerable jsPDF Acroform APIs. The attacker typically needs a way to control option labels, appearance states, or similar fields that are passed into those APIs.

The attacker must be able to influence the data passed into jsPDF's Acroform methods, such as through form inputs, configuration dashboards, template editors, or APIs that ultimately feed into PDF generation. Direct access to the PDF generation code is not required; control over its inputs is sufficient.

Restrict Acroform-related inputs to vetted, strongly typed values controlled by the application, and prevent arbitrary strings from being used as structural parts of the PDF. In addition, ensure that any dynamic content is correctly encoded for the PDF context so it cannot alter document structure or introduce actions.

Treat all document-generation libraries as sinks for untrusted input and design around strict separation of content and structure. Adopt a secure-by-default wrapper around jsPDF (and similar tools) that exposes only safe operations, enforce validation and whitelisting on all user-supplied configuration, and incorporate automated checks in CI to flag direct use of low-level injection-prone APIs with untrusted data.

Find out what's already
exploitable in your codebase.