CVE-2023-39062 Spipu HTML2PDF vulnerable to cross-site scripting

Medium 6.1 Published Updated

A remote attacker can execute arbitrary code via a crafted script in the HTML2PDF library's forms.php file.

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-2023-39062?

CVE-2023-39062 is a medium-severity cross-site scripting vulnerability in n/a, published on 28 Aug 2023. 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

Cross Site Scripting vulnerability in Spipu HTML2PDF before v.5.2.8 allows a remote attacker to execute arbitrary code via a crafted script to the forms.php.

Weakness: CWE-79

Which versions are affected by CVE-2023-39062?

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

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

Products include Html2pdf Project Html2pdf.

How do I fix CVE-2023-39062?

Upgrade spipu/html2pdf to 5.2.8 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2023-39062 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-39062 exists.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as GHSA-99fg-2h75-m92h.

Is CVE-2023-39062 in your software?

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

Check your SBOMs for free