CVE-2024-22641
High · 7.5CVSS
7.5
EPSS
1.1%
Published
May 28, 2024
CISA due date
—
Cloudanix analysis
A library used to create PDF files can be overwhelmed by certain image files, causing the software that relies on it to slow down or stop working until restarted.
- 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
A crafted SVG input triggers catastrophic backtracking in a regular expression used during SVG parsing, causing the process to consume excessive CPU and potentially hang indefinitely.
Why it matters to the business
Applications that accept or process untrusted SVG files through the library can experience sudden unresponsiveness or resource exhaustion, interrupting document generation workflows and requiring manual intervention to restore service.
How an attack unfolds
An attacker supplies a malicious SVG file containing input engineered to exploit the vulnerable regex; when the library parses the file the regex engine enters repeated backtracking, leading to denial of service without any authentication or special privileges.
How to fix it
Upgrade the library to the first version containing a corrected regular expression; if no patched release is yet published, disable SVG parsing or add strict input validation and resource limits around SVG processing until an update is available.
How to confirm the fix worked
Confirm the installed library version is newer than 6.6.5; test the parser with a known ReDoS SVG payload under controlled conditions and verify that CPU usage remains bounded and processing completes promptly.
Typical attack path
- Locate an application or service that uses the vulnerable library to render or convert SVG content into PDF.
- Craft an SVG file containing a string that forces exponential regex backtracking.
- Submit the SVG through any user-controlled input path (upload, API, or embedded content).
- Observe sustained high CPU usage and eventual timeout or crash of the processing thread or worker.
How to detect it
Monitor process-level CPU and memory metrics for workers handling PDF generation; inspect application or web-server logs for requests that include SVG payloads immediately preceding resource-exhaustion events.
What your security team should do
- Treat as high-priority availability issue and schedule upgrade within normal change windows.
- Add runtime timeouts and memory/CPU limits to any worker processes that invoke the library on untrusted input.
- Review logs and monitoring for sudden spikes in CPU correlated with SVG processing jobs.
- Consider temporarily disabling SVG-to-PDF conversion paths if the update cannot be applied quickly.
The record
TCPDF version 6.6.5 and before is vulnerable to ReDoS (Regular Expression Denial of Service) if parsing an untrusted SVG file.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | tcpdf | 0 | No fix |
| Debian:12 | tcpdf | 0 | No fix |
| Debian:13 | tcpdf | 0 | No fix |
| Mageia:9 | php-tcpdf | 0 | 6.5.0-1.2.mga9 |
| Ubuntu:14.04:LTS | tcpdf | 0 | No fix |
| Ubuntu:16.04:LTS | tcpdf | 0 | No fix |
| Ubuntu:18.04:LTS | tcpdf | 0 | No fix |
| Ubuntu:20.04:LTS | tcpdf | 0 | No fix |
| Ubuntu:22.04:LTS | tcpdf | 0 | No fix |
| Ubuntu:24.04:LTS | tcpdf | 0 | No fix |
| Ubuntu:24.10 | tcpdf | 0 | No fix |
| Ubuntu:25.04 | tcpdf | 0 | No fix |
| Ubuntu:25.10 | tcpdf | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | tcpdf | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | tcpdf | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | tcpdf | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | tcpdf | 0 | No fix |
Related vulnerabilities
- CVE-2024-56520 An issue was discovered in tc-lib-pdf-font before 2.6.4, as used in TCPDF before 6.8.0… Also affects tcpdf
- CVE-2024-56527 TCPDF missing character escape on error messages Also affects tcpdf
- CVE-2024-56519 TCPDF lacks SVG sanitization Also affects tcpdf
- CVE-2024-56521 TCPDF missing certificate validation Also affects tcpdf
- CVE-2024-56522 TCPDF has incorrect comparison Also affects tcpdf
- CVE-2024-51058 TCPDF Local File Inclusion vulnerability Also affects tcpdf
- CVE-2024-22640 TCPDF version <=6.6.5 is vulnerable to ReDoS (Regular Expression Denial of Service) if… Also affects tcpdf
- CVE-2024-32489 TCPDF before 6.7.4 mishandles calls that use HTML syntax. Also affects tcpdf