Skip to content
Heist/ feed
Back to feed
High

html2pdf.js has a cross-site scripting vulnerability

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-22787
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 02:22 UTC · Revision 1

Source evidence

html2pdf.js has a cross-site scripting vulnerability

core-osv · Original source

Published 14 Jan 2026, 16:52 UTC

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.

osv:CVE-2026-22787
Complete source record
{
  "id": "c51299ddf7752c87ef34786dbaaa5332aab737528e5effaa94bf826bba0e946d",
  "url": "https://osv.dev/vulnerability/CVE-2026-22787",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "html2pdf.js has a cross-site scripting vulnerability",
    "summary": "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.",
    "evidence": "osv:CVE-2026-22787",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-22787",
      "aliases": [
        "CVE-2026-22787",
        "GHSA-w8x4-x68c-m6fc"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "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"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/ekoopmans/html2pdf.js",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "29a31027d105782f10918bbf7fcada67488199dc"
                },
                {
                  "fixed": "988826e336035b39a8608182d7b73c0e3cd78c7b"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:ekoopmans:html2pdf.js:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "0.14.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "988826e336035b39a8608182d7b73c0e3cd78c7b"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "29a31027d105782f10918bbf7fcada67488199dc"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v0.14.0"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v0.13.0",
            "v0.12.1",
            "v0.12.0",
            "v0.11.3",
            "v0.11.2",
            "v0.11.1",
            "v0.11.0",
            "v0.10.3",
            "v0.10.2",
            "v0.10.1",
            "v0.10.0",
            "v0.9.3",
            "v0.9.2",
            "v0.7.6",
            "v0.7.5",
            "v0.7.4",
            "v0.7.3",
            "v0.7.2",
            "v0.7.1",
            "v0.7.0",
            "v0.6.0",
            "v0.5.3",
            "v0.5.2",
            "v0.5.1",
            "v0.5.0",
            "v0.4.0",
            "v0.3.0",
            "v0.2.0",
            "v0.1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-22787.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:25.290040006Z",
      "provider": "osv",
      "references": [
        "https://aydinnyunus.github.io/2026/01/17/cve-2026-22787-html2pdf-xss-vulnerability/",
        "https://github.com/eKoopmans/html2pdf.js/releases/tag/v0.14.0",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22787.json",
        "https://github.com/eKoopmans/html2pdf.js/security/advisories/GHSA-w8x4-x68c-m6fc",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-22787",
        "https://github.com/eKoopmans/html2pdf.js/issues/865",
        "https://github.com/eKoopmans/html2pdf.js/commit/988826e336035b39a8608182d7b73c0e3cd78c7b",
        "https://github.com/eKoopmans/html2pdf.js/pull/877"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-79"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22787.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-22787",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 491844,
  "published_at": "2026-01-14T16:52:38.372+00:00"
}