LiveActive security incident?Get immediate response
CVE Record

CVE-2026-22787: html2pdf.js has 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.

HighCVSS 8.7Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

CVE-2026-22787 affects html2pdf.js, a client-side library used to turn web content into PDFs. Versions before 0.14.0 can mishandle text input and place unsafe content into the browser page, allowing cross-site scripting. Impact depends on where the library is used and whether attacker-controlled text can reach PDF generation.

Executive priority

Treat as a high-priority frontend dependency update for applications that generate PDFs from user-controlled content. Prioritize internet-facing portals, customer document workflows, and administrative tools where browser session data is sensitive.

Technical view

html2pdf.js before 0.14.0 has a CWE-79 XSS issue when given a text source instead of an element. The text is insufficiently sanitized before DOM attachment, enabling script execution in the client browser. The CVSS 4.0 score is 8.7 with network attack vector, low complexity, no privileges, and user interaction required.

Likely exposure

Applications are most exposed if they use html2pdf.js versions below 0.14.0 and pass user-supplied or untrusted text into the library for PDF generation. Exposure may be indirect through bundled frontend dependencies or copied vendor scripts.

Exploitation context

The sources do not indicate known active exploitation, and this CVE is not marked KEV. Exploitation requires a user interaction path where malicious text is processed by vulnerable html2pdf.js in a browser context. Successful abuse could affect page data confidentiality and integrity.

Researcher notes

Evidence identifies the vulnerable condition, affected versions, CVSS vector, fix version, GitHub advisory, issue, pull request, commit, and release. Public sources provided here do not establish exploitation in the wild. Validate exposure by tracing whether text input reaches html2pdf.js before DOM insertion.

Mitigation direction

  • Upgrade html2pdf.js to version 0.14.0 or later.
  • Review vendor advisory and release notes before deployment.
  • Identify bundled or vendored copies of html2pdf.js in frontend assets.
  • Avoid passing untrusted text to vulnerable versions until upgraded.
  • Apply normal XSS defenses where html2pdf.js output touches the DOM.

Validation and detection

  • Inventory package manifests and lockfiles for html2pdf.js versions below 0.14.0.
  • Search built frontend assets for bundled html2pdf.js copies.
  • Review PDF generation code paths for text-source usage.
  • Confirm deployed applications load the upgraded library version.
  • Check dependency scanners for CVE-2026-22787 or GHSA-w8x4-x68c-m6fc.
Prepared
Confidence
high
Sources
8

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-79: User-session and phishing behavior lookup

Client-side and session-facing weaknesses should be reviewed alongside initial-access and user-execution behaviors. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-22787 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.7 (4.0)
Known Exploited
No
Published

Vector: 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

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
7Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.7CVSS 4.0HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N——Primary CVE score

Vulnerability scoring details

Base CVSS 4.0 score

8.7High
CVSS 4.0 vector shape for CVE-2026-22787Attack VectorAttack ComplexityAttack RequirementsPrivileges RequiredUser InteractionVS ConfidentialityVS IntegrityVS AvailabilitySS ConfidentialitySS IntegritySS Availability

Vector: 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

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Attack Requirements
NonePresent
Privileges Required
NoneLowHigh
User Interaction
NonePassiveActive
VS Confidentiality
HighLowNone
VS Integrity
HighLowNone
VS Availability
HighLowNone
SS Confidentiality
HighLowNone
SS Integrity
HighLowNone
SS Availability
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
eKoopmanshtml2pdf.js< 0.14.0Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-79 · source CWE mapping

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.