CVE-2024-25885
High · 7.5CVSS
7.5
EPSS
0.6%
Published
Oct 8, 2024
CISA due date
—
Cloudanix analysis
A bug in a PDF creation library lets attackers send special data that can make the system slow down or stop responding, disrupting normal operations.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The flaw permits an attacker to supply a crafted string to the getcolor function that triggers catastrophic backtracking in its regular expression, resulting in excessive CPU consumption and denial of service.
Why it matters to the business
Applications using the library can be forced into unresponsiveness or high resource usage, causing service outages, degraded performance for legitimate users, and increased infrastructure costs until the attack stops.
How an attack unfolds
An attacker locates any code path that passes untrusted input to the vulnerable getcolor function, crafts a string that forces the regex engine into repeated backtracking, and submits it repeatedly to exhaust CPU resources and deny service to other users.
How to fix it
Upgrade xhtml2pdf to the latest patched release; where immediate upgrade is not possible, add input length limits, replace the vulnerable regex, or enforce execution timeouts around color parsing.
How to confirm the fix worked
Confirm the installed xhtml2pdf version is current, then execute the getcolor function against known ReDOS test strings and verify that processing completes within expected time bounds without spikes in CPU usage.
Typical attack path
- Locate an input vector that reaches the getcolor function in utils.py
- Construct a malicious string engineered for regex ReDOS
- Deliver the string via HTTP request, API call, or file processing
- Sustain traffic to maintain CPU exhaustion and service degradation
How to detect it
Inspect application and system logs for sustained high CPU usage correlated with color parsing or PDF generation requests; review web server access logs for repeated submissions of unusually long or patterned strings to affected endpoints.
What your security team should do
- Apply the library upgrade as the primary remediation
- Add input validation and regex timeouts as defense-in-depth
- Monitor application CPU and request latency for anomalies
- Review and restrict untrusted color or style inputs where feasible
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | xhtml2pdf | 0 | No fix |
| Debian:11 | xhtml2pdf | 0 | No fix |
| Debian:12 | xhtml2pdf | 0 | No fix |
| Debian:13 | xhtml2pdf | 0 | No fix |
| Ubuntu:18.04:LTS | xhtml2pdf | 0 | No fix |
| Ubuntu:20.04:LTS | xhtml2pdf | 0 | No fix |
| Ubuntu:22.04:LTS | xhtml2pdf | 0 | No fix |
| Ubuntu:24.04:LTS | xhtml2pdf | 0 | No fix |
| Ubuntu:24.10 | xhtml2pdf | 0 | No fix |
| Ubuntu:25.04 | xhtml2pdf | 0 | No fix |
| Ubuntu:25.10 | xhtml2pdf | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | xhtml2pdf | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | xhtml2pdf | 0 | No fix |
| openSUSE:Tumbleweed | python-xhtml2pdf | 0 | 0.2.16-2.1 |
Related vulnerabilities
- CVE-2026-62864 Ring is a Clojure web applications library inspired by Python's WSGI and Ruby's Rack. CWE-1333
- CVE-2026-119300 Wekan is open source kanban built with Meteor. CWE-1333
- CVE-2026-118993 CallBackery versions before 0.62.0 for Perl allow denial of service via the request path… CWE-1333
- CVE-2026-115866 Starlet versions from 0.20 before 0.33 for Perl allow CPU exhaustion via regular… CWE-1333
- CVE-2026-119202 @hapi/content provides HTTP Content-* header parsing. CWE-1333
- CVE-2026-118779 Forge (also called node-forge) is a native implementation of Transport Layer Security in… CWE-1333
- CVE-2026-118772 joi is a schema description language and data validator for JavaScript. CWE-1333
- CVE-2026-118686 EspoCRM before 9.3.11 and 10.x before 10.0.8 contains a denial of service vulnerability… CWE-1333