CVE-2024-25885 xhtml2pdf Denial of Service via crafted string

High 7.5 Published Updated

Attackers can cause a denial of service in xhtml2pdf by supplying a crafted string to the getcolor function, triggering a regular expression DoS.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-25885?

CVE-2024-25885 is a high-severity denial of service vulnerability in n/a, published on 8 Oct 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

An issue in the getcolor function in utils.py of xhtml2pdf v0.2.13 allows attackers to cause a Regular expression Denial of Service (ReDOS) via supplying a crafted string.

Weakness: CWE-1333

Which versions are affected by CVE-2024-25885?

3 open source packages ship an affected version, including xhtml2pdf.

PackageAffectedFixed in
xhtml2pdf PyPIAll versions to 0.2.16None
xhtml2pdf PyPIAll versions to 0.2.16None
xhtml2pdf PyPIAll versions to 0.2.16None
Linux distribution packages (1)
python-xhtml2pdf openSUSE:TumbleweedAll versions0.2.16-2.1

How do I fix CVE-2024-25885?

Upgrade to a fixed version.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2024-25885 being exploited?

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

Sources

Also known as DEBIAN-CVE-2024-25885, GHSA-jj5c-hhrg-vv5h, PYSEC-2026-2056, UBUNTU-CVE-2024-25885, openSUSE-SU-2024:14601-1.

Is CVE-2024-25885 in your software?

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

Check your SBOMs for free