Appsecure logo

CVE-2026-22787: High Vulnerability in ekoopmans html2pdf.js

A high-severity cross-site scripting (XSS) vulnerability in ekoopmans html2pdf.js prior to version 0.14.0 allows attackers to execute malicious scripts. Organizations should prioritize patching immediately to mitigate risks.

HIGHCVSS 8.7 · Published January 14, 2026

Not a customer? See how AppSecure simulates real world attacks to protect your infrastructure.

Speak to Experts

The recently identified vulnerability, CVE-2026-22787, affects the ekoopmans html2pdf.js library, which enables the conversion of web pages into printable PDFs entirely client-side. This vulnerability allows cross-site scripting (XSS) attacks when a text source is provided instead of an HTML element. Prior to version 0.14.0, the library failed to adequately sanitize text before appending it to the Document Object Model (DOM), posing significant risks to the confidentiality, integrity, and availability of the page's data.

With a CVSS score of 8.7, this vulnerability is classified as high-severity, indicating that it is crucial for organizations utilizing this library to take immediate action. The potential for exploitation exists due to its nature, as attackers may leverage this vulnerability to execute arbitrary scripts within the context of the user's browser.

Organizations should prioritize patching immediately. The vulnerability has been addressed in html2pdf.js version 0.14.0, which incorporates necessary sanitization measures to prevent such attacks. Users running versions prior to this update are advised to upgrade as soon as possible to mitigate risks associated with this vulnerability.

As of now, no public exploit has been confirmed, but the nature of the vulnerability necessitates vigilance from security teams. Adopting a proactive stance will help protect against potential threats that may emerge as awareness of this vulnerability spreads.

The urgency of this vulnerability is underscored by its high exploitation potential. Organizations using html2pdf.js must evaluate their exposure and implement necessary updates without delay.

In summary, CVE-2026-22787 represents a significant risk for organizations that rely on ekoopmans html2pdf.js. With the threat of XSS attacks looming, immediate remediation is essential to safeguard sensitive data and ensure the integrity of web applications.

Vulnerability Details

The vulnerability is classified as a cross-site scripting (XSS) issue, identified as CWE-79. The official description notes that prior to version 0.14.0, html2pdf.js does not sufficiently sanitize text sources, allowing for the execution of malicious scripts within the client browser.

The CVSS 4.0 score of 8.7 classifies this vulnerability as high, indicating a serious risk to confidentiality and integrity, with a low impact on availability. Users must be aware that the required user interaction is passive, meaning that a user does not need to take any explicit actions for an attack to be successful.

The vulnerability was published on January 14, 2026. Organizations using this library should ensure that they have updated to the latest version to avoid potential exploitation.

Technical Analysis

The root cause of this vulnerability lies in the inadequate sanitization of text sources before they are added to the DOM. The attack vector is network-based, with low attack complexity, meaning that an attacker can easily exploit this vulnerability without requiring advanced skills.

The vulnerability does not require any privileges to exploit, and it necessitates user interaction, albeit passively. The impacts of a successful exploit include high confidentiality and integrity risks, while availability is impacted minimally.

Risk & Impact Analysis

Organizations utilizing html2pdf.js are at risk of various attacks due to this vulnerability. Attackers may leverage the XSS flaw to execute scripts that can capture sensitive data, manipulate user sessions, or spread malware. The potential for such risks underscores the necessity for immediate action.

The blast radius for this vulnerability could be extensive, impacting any web application that utilizes the affected library. Given the nature of XSS attacks, the consequences can be severe, leading to data breaches and loss of user trust.

Based on the CVSS score of 8.7, organizations should address this vulnerability in their priority patch cycle. The existence of this vulnerability emphasizes the need for robust security practices, including regular updates to third-party libraries.

Exploitation Status

Signal

Status

Known Exploit

No

Public PoC

No

Actively Exploited

No

Ransomware Use

No

Affected Versions

The vulnerability affects all versions of html2pdf.js prior to 0.14.0. Organizations must ensure they upgrade to this version or later to mitigate the risks associated with this vulnerability.

Mitigation & Remediation

To mitigate this vulnerability, organizations should immediately upgrade to html2pdf.js version 0.14.0 or later. This version includes fixes for the XSS vulnerability.

If an immediate upgrade is not feasible, consider implementing input sanitization measures to validate text sources before processing them. Additionally, organizations should review their applications for any usage of html2pdf.js and assess exposure to this vulnerability.

For ongoing security, organizations may also consider engaging in penetration testing to identify further vulnerabilities and ensure robust defenses.

Detection Guidance

Organizations should monitor logs for any unusual behavior that could indicate exploitation attempts. Key indicators include the presence of unexpected scripts being executed or anomalies in user interactions with web applications that utilize html2pdf.js.

Additionally, implement network monitoring to detect any suspicious traffic patterns that may suggest an active exploitation of this vulnerability.

AppSecure Threat Intelligence Insight

CVE-2026-22787 highlights a critical aspect of web application security: the need for thorough validation of user inputs. As the frequency of XSS vulnerabilities continues to rise, organizations must prioritize secure coding practices and regular updates to third-party libraries.

By fostering a culture of security awareness among development teams, organizations can significantly reduce the risk of similar vulnerabilities emerging in the future. Security testing should become an integral part of the development lifecycle.

For additional insights on secure coding and the importance of vulnerability management, organizations can refer to the following resources: penetration testing methodology, vulnerability management program design, and security testing best practices.

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Latest CVEs. Recently published vulnerabilities from the NVD database.

View all vulnerabilities
CVE IDSeverity
CVE-2025-65418HIGH
CVE-2025-65417MEDIUM
CVE-2025-65416MEDIUM
CVE-2025-65415MEDIUM
CVE-2025-61314HIGH

Protect Your Business with Hacker-Focused Approach.