CVE-2021-45394 Cross-site Scripting in HTML2PDF

High 8.8 Published Updated

Attackers can execute arbitrary code by injecting malicious link tags into HTML documents processed by the HTML2PDF library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-45394?

CVE-2021-45394 is a high-severity unsafe deserialization vulnerability in n/a, published on 18 Jan 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

An issue was discovered in Spipu HTML2PDF before 5.2.4. Attackers can trigger deserialization of arbitrary data via the injection of a malicious <link> tag in the converted HTML document.

Weakness: CWE-918, CWE-502

Which versions are affected by CVE-2021-45394?

2 open source packages ship an affected version, including spipu/html2pdf. It affects 1 product.

PackageAffectedFixed in
spipu/html2pdf PackagistAll versions5.2.4
spipu/html2pdf PackagistAll versions5.2.4

Products include Html2pdf Project Html2pdf.

How do I fix CVE-2021-45394?

Upgrade spipu/html2pdf to 5.2.4 or later.

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2021-45394 being exploited?

There is no known exploitation of CVE-2021-45394 in the wild and no public exploit code.

Sources

Also known as GHSA-6m93-343m-3jrc.

Is CVE-2021-45394 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free