The vulnerability, identified as CVE-2026-24737, is a PDF injection issue within the AcroForm module of the jsPDF library. The root cause is the improper escaping of user-controlled input when generating PDF form elements, which allows for the injection of arbitrary PDF objects and subsequent JavaScript execution.
The analysis of the patch da291a5f01b96282545c9391996702cdb8879f79 reveals two primary attack vectors:
-
Choice Fields (AcroFormChoiceField): The methods addOption and setOptions serve as entry points for malicious data. User-provided option strings were passed to an internal function, arrayToPdfArray, for inclusion in the PDF structure. This function failed to escape strings that began with a forward slash ('/'), treating them as literal PDF objects instead of string literals. This allowed an attacker to inject malicious PDF syntax, such as /AA (Additional Actions) to trigger JavaScript execution. The patch introduces a new pdfEscapeName function and modifies arrayToPdfArray to use it, ensuring that such strings are properly escaped.
-
Button Fields (AcroFormCheckBox, AcroFormRadioButton): These classes inherit from AcroFormButton. The appearanceState property setter on AcroFormButton was vulnerable. It would prepend a '/' to the user-provided value without any sanitization. This created another injection vector where a crafted string could be interpreted as PDF commands. The patch addresses this by applying the pdfEscapeName function to the value within the setter, neutralizing the threat.
Therefore, any runtime profile during exploitation would show calls to AcroFormChoiceField.addOption or AcroFormChoiceField.setOptions, or property setting on AcroFormCheckBox.appearanceState or AcroFormRadioButton.appearanceState, which internally calls the vulnerable setter on AcroFormButton.