CVE-2026-22787
HIGH 8.7CVSS 4.0html2pdf.js contains a cross-site scripting vulnerability
html2pdf.js converts any webpage or element into a printable PDF entirely client-side. Prior to 0.14.0, html2pdf.js contains a cross-site scripting (XSS) vulnerability when given a text source rather than an element. This text is not sufficiently sanitized before being attached to the DOM, allowing malicious scripts to be run on the client browser and risking the confidentiality, integrity, and availability of the page's data. This vulnerability has been fixed in html2pdf.js@0.14.0.
- Published
- 14 Jan 2026
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-79
- Also known as
- GHSA-w8x4-x68c-m6fc
- Sources
- NVDJSONOSV GHSA-w8x4-x68c-m6fcJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 4.0 | HIGH 8.7 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N | |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | ekoopmans | html2pdf.jscpe:2.3:a:ekoopmans:html2pdf.js:*:*:*:*:*:node.js:*:* |
< 0.14.0 | 0.14.0 |
| OSV | npm | html2pdf.js | < 0.14.0 | 0.14.0 |
References
- https://github.com/eKoopmans/html2pdf.js/commit/988826e336035b39a8608182d7b73c0e3cd78c7b · Patch, WEB
- https://github.com/eKoopmans/html2pdf.js/issues/865 · Issue Tracking, WEB
- https://github.com/eKoopmans/html2pdf.js/pull/877 · Issue Tracking, Patch, WEB
- https://github.com/eKoopmans/html2pdf.js/releases/tag/v0.14.0 · Release Notes, WEB
- https://github.com/eKoopmans/html2pdf.js/security/advisories/GHSA-w8x4-x68c-m6fc · Patch, Vendor Advisory, WEB
- https://aydinnyunus.github.io/2026/01/17/cve-2026-22787-html2pdf-xss-vulnerability/ · Exploit, Mitigation, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-22787 · ADVISORY
- https://github.com/eKoopmans/html2pdf.js · PACKAGE
History
- 25 Nov 2026 21:01 UTC · NVD: first stored (published 14 Jan 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 14 Jan 2026)