Intel

AIKIDO-2025-10440

pdf2html is vulnerable to Cross-site Scripting (XSS)

Cross-site Scripting (XSS) Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Jul 7, 2025

88

High Risk

This Affects:

JSpdf2html
4.0.0 - 4.3.0
Fixed in 4.3.1
Are you affected? Scan for Free

TL;DR

Affected versions of this package are vulnerable to Cross-Site Scripting (XSS) due to improper sanitization of HTML content in the extractPages function. The function used to extract .page elements returns either raw HTML or text without sanitizing user-supplied input, allowing attackers to inject malicious scripts. An attacker could exploit this vulnerability by crafting a payload within a .page element, which would then be rendered unsanitized in the browser, allowing arbitrary JavaScript to execute in the context of the victim's session. It could lead to session hijacking, data theft, or other malicious actions.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

pdf2html is vulnerable to Cross-site Scripting (XSS) in versions 4.0.0 - 4.3.0.

How to fix this

Upgrade the pdf2html library to a patch version.