


Perceptive Security
SOC/SIEM Consultancy

jsPDF is a library to generate PDFs in JavaScript. Prior to version 4.2.1, user control of the `options` argument of the `output` function allows attackers to i…
Published:
17 maart 2026 om 23:00:00
Alert date:
18 maart 2026 om 16:03:59
Source:
nvd.nist.gov
Web Technologies, Supply Chain & Dependencies
jsPDF library versions prior to 4.2.1 contain a vulnerability that allows attackers to inject arbitrary HTML and scripts into browser contexts when PDFs are opened. The vulnerability stems from insufficient sanitization of the options argument in the output function. Attackers can exploit this through web interfaces by providing malicious output options that get passed to victims. When victims create and open PDFs with the malicious payload, scripts execute in their browser context, potentially allowing extraction or modification of secrets. The vulnerability has been patched in version 4.2.1, and users can mitigate by sanitizing input before passing to the output method.
Technical details
Mitigation steps:
Affected products:
jsPDF
Related links:
https://nvd.nist.gov/vuln/detail/CVE-2026-31938
https://github.com/parallax/jsPDF/commit/87a40bbd07e6b30575196370670b41f264aa78d7
https://github.com/parallax/jsPDF/releases/tag/v4.2.1
https://github.com/parallax/jsPDF/security/advisories/GHSA-wfv2-pwc8-crg5
Related CVE's:
Related threat actors:
IOC's:
This article was created with the assistance of AI technology by Perceptive.
