CVE-2026-22787: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in eKoopmans html2pdf.js
CVE-2026-22787 is a high-severity cross-site scripting (XSS) vulnerability in html2pdf. js versions prior to 0. 14. 0. The vulnerability arises when the library processes text sources instead of DOM elements without proper sanitization, allowing malicious scripts to be injected and executed in the client browser. This can compromise the confidentiality, integrity, and availability of web page data. Exploitation requires user interaction but no authentication or privileges. The issue has been fixed in version 0. 14. 0.
AI Analysis
Technical Summary
html2pdf.js is a client-side JavaScript library that converts web pages or elements into printable PDFs. Versions prior to 0.14.0 contain a cross-site scripting (XSS) vulnerability identified as CVE-2026-22787 (CWE-79). The vulnerability occurs when the library is given a text source instead of a DOM element; the text is insufficiently sanitized before being appended to the DOM. This improper neutralization of input allows attackers to inject malicious scripts that execute in the context of the victim's browser. The CVSS 4.0 score of 8.7 reflects the vulnerability's high severity, with network attack vector, low attack complexity, no privileges or authentication required, but requiring user interaction. The vulnerability can lead to the compromise of confidentiality (e.g., theft of sensitive data), integrity (e.g., manipulation of page content), and availability (e.g., disruption of page functionality). Although no known exploits are currently reported in the wild, the widespread use of html2pdf.js in web applications makes this a significant risk. The issue was resolved in version 0.14.0 by improving input sanitization and handling of text sources. The vulnerability does not affect server-side components but targets client browsers rendering affected web pages.
Potential Impact
For European organizations, this vulnerability poses a significant risk to web applications that utilize vulnerable versions of html2pdf.js. Successful exploitation can lead to client-side script execution, enabling attackers to steal user credentials, session cookies, or other sensitive information, potentially leading to account takeover or data breaches. It can also allow attackers to manipulate or deface web content, damaging organizational reputation. The availability of web services could be impacted if attackers inject scripts that disrupt page functionality or perform denial-of-service actions on the client side. Sectors with high reliance on web-based document generation or PDF exports, such as finance, healthcare, and government, are particularly vulnerable. Given the ease of exploitation and lack of required privileges, the threat is substantial, especially for organizations with large user bases in Europe. The vulnerability could also facilitate further attacks, such as phishing or malware distribution, by compromising trusted web pages.
Mitigation Recommendations
The primary mitigation is to upgrade all instances of html2pdf.js to version 0.14.0 or later, where the vulnerability is fixed. Organizations should audit their web applications to identify usage of html2pdf.js and verify the version in use. Additionally, implement strict input validation and sanitization on all user-supplied data before processing or rendering. Employ Content Security Policies (CSP) to restrict the execution of unauthorized scripts and reduce the impact of potential XSS attacks. Regularly monitor web application behavior for signs of script injection or anomalous activity. Educate developers on secure coding practices related to client-side libraries and the risks of processing untrusted input. Consider using security-focused code scanning tools to detect vulnerable dependencies. Finally, maintain an incident response plan to quickly address any exploitation attempts.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Sweden
CVE-2026-22787: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in eKoopmans html2pdf.js
Description
CVE-2026-22787 is a high-severity cross-site scripting (XSS) vulnerability in html2pdf. js versions prior to 0. 14. 0. The vulnerability arises when the library processes text sources instead of DOM elements without proper sanitization, allowing malicious scripts to be injected and executed in the client browser. This can compromise the confidentiality, integrity, and availability of web page data. Exploitation requires user interaction but no authentication or privileges. The issue has been fixed in version 0. 14. 0.
AI-Powered Analysis
Technical Analysis
html2pdf.js is a client-side JavaScript library that converts web pages or elements into printable PDFs. Versions prior to 0.14.0 contain a cross-site scripting (XSS) vulnerability identified as CVE-2026-22787 (CWE-79). The vulnerability occurs when the library is given a text source instead of a DOM element; the text is insufficiently sanitized before being appended to the DOM. This improper neutralization of input allows attackers to inject malicious scripts that execute in the context of the victim's browser. The CVSS 4.0 score of 8.7 reflects the vulnerability's high severity, with network attack vector, low attack complexity, no privileges or authentication required, but requiring user interaction. The vulnerability can lead to the compromise of confidentiality (e.g., theft of sensitive data), integrity (e.g., manipulation of page content), and availability (e.g., disruption of page functionality). Although no known exploits are currently reported in the wild, the widespread use of html2pdf.js in web applications makes this a significant risk. The issue was resolved in version 0.14.0 by improving input sanitization and handling of text sources. The vulnerability does not affect server-side components but targets client browsers rendering affected web pages.
Potential Impact
For European organizations, this vulnerability poses a significant risk to web applications that utilize vulnerable versions of html2pdf.js. Successful exploitation can lead to client-side script execution, enabling attackers to steal user credentials, session cookies, or other sensitive information, potentially leading to account takeover or data breaches. It can also allow attackers to manipulate or deface web content, damaging organizational reputation. The availability of web services could be impacted if attackers inject scripts that disrupt page functionality or perform denial-of-service actions on the client side. Sectors with high reliance on web-based document generation or PDF exports, such as finance, healthcare, and government, are particularly vulnerable. Given the ease of exploitation and lack of required privileges, the threat is substantial, especially for organizations with large user bases in Europe. The vulnerability could also facilitate further attacks, such as phishing or malware distribution, by compromising trusted web pages.
Mitigation Recommendations
The primary mitigation is to upgrade all instances of html2pdf.js to version 0.14.0 or later, where the vulnerability is fixed. Organizations should audit their web applications to identify usage of html2pdf.js and verify the version in use. Additionally, implement strict input validation and sanitization on all user-supplied data before processing or rendering. Employ Content Security Policies (CSP) to restrict the execution of unauthorized scripts and reduce the impact of potential XSS attacks. Regularly monitor web application behavior for signs of script injection or anomalous activity. Educate developers on secure coding practices related to client-side libraries and the risks of processing untrusted input. Consider using security-focused code scanning tools to detect vulnerable dependencies. Finally, maintain an incident response plan to quickly address any exploitation attempts.
Affected Countries
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-01-09T18:27:19.388Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6967e9c5f809b25a98cd9f49
Added to database: 1/14/2026, 7:08:53 PM
Last enriched: 1/14/2026, 7:09:59 PM
Last updated: 1/14/2026, 8:10:36 PM
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2026-22036: CWE-770: Allocation of Resources Without Limits or Throttling in nodejs undici
LowCVE-2026-22779: CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') in Neoteroi BlackSheep
MediumCVE-2025-67835: n/a
HighCVE-2025-67834: n/a
HighCVE-2025-67833: n/a
MediumActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.