jsPDF vulnerabilities
7 known CVE vulnerabilities in jsPDF, translated and rated.
- CVE-2026-31938Critical
The jsPDF library prior to version 4.2.1 is vulnerable to HTML injection (including scripts) via user control of the `options` argument in the `output` function. An attacker can supply malicious values that, when the PDF is generated and opened in the victim's browser, execute in the victim's browser context.
- CVE-2026-31898High
jsPDF library prior to version 4.2.1 is vulnerable to injection of arbitrary PDF objects, including JavaScript actions, via the `color` parameter of the `createAnnotation` method. An attacker can exploit this to execute malicious code when the PDF is opened.
- CVE-2026-25940High
The jsPDF library prior to version 4.2.0 contains a vulnerability that allows injection of arbitrary PDF objects, including JavaScript actions, through control of Acroform module properties and methods. The attack can be triggered when the victim hovers over a radio option.
- CVE-2026-25755High
The jsPDF library prior to version 4.2.0 is vulnerable to injection of arbitrary PDF objects via user-controlled argument of the `addJS` method. An attacker can escape JavaScript string delimiters to alter document structure or execute malicious actions.
- CVE-2026-25535High
The jsPDF library prior to version 4.2.0 is vulnerable to a denial of service attack via user control of the first argument of the `addImage` method. Passing a malicious GIF file with large width/height headers causes excessive memory allocation and denial of service. The `html` method is also affected.
- CVE-2026-24737High
The jsPDF library prior to version 4.1.0 has a vulnerability that allows injection of arbitrary PDF objects, including JavaScript actions, through user control of Acroform module properties and methods. Attackers can exploit unsanitized input in methods such as AcroformChoiceField.addOption, AcroformChoiceField.setOptions, AcroFormCheckBox.appearanceState, and AcroFormRadioButton.appearanceState.
- CVE-2025-68428High
The jsPDF library prior to version 4.0.0 is vulnerable to local file inclusion and path traversal. An attacker can exploit the loadFile method, as well as addImage, html, and addFont, to read arbitrary files from the server's file system. The file contents are then embedded in generated PDF documents.

