{"cve":"CVE-2026-31938","nvd":{"published":"2026-03-18T04:17:23.507","modified":"2026-08-18T12:18:06.707","status":"Modified","description":"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 inject arbitrary HTML (such as scripts) into the browser context the created PDF is opened in. The vulnerability can be exploited in the following scenario: the attacker provides values for the output options, for example via a web interface. These values are then passed unsanitized (automatically or semi-automatically) to the attack victim. The victim creates and opens a PDF with the attack vector using one of the vulnerable method overloads inside their browser. The attacker can thus inject scripts that run in the victims browser context and can extract or modify secrets from this context. The vulnerability has been fixed in jspdf@4.2.1. As a workaround, sanitize user input before passing it to the output method.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1},"cwes":["CWE-79"],"references":["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","https://access.redhat.com/errata/RHSA-2026:7110","https://access.redhat.com/errata/RHSA-2026:7128"],"products":["parall:jspdf"],"source":"nvd","synced_at":"2026-10-19T22:26:19.218427112+00:00"},"epss":{"cve":"CVE-2026-31938","score":0.00274,"percentile":0.19851,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-wfv2-pwc8-crg5","url":"https://osv.dev/vulnerability/GHSA-wfv2-pwc8-crg5","summary":"jsPDF has HTML Injection in New Window paths","modified":"2026-09-10T03:50:41.577731720Z","packages":[{"ecosystem":"npm","name":"jspdf","purl":"pkg:npm/jspdf","ranges":["<4.2.1"],"fixed":["4.2.1"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}