CVE-2024-56519
NoneTCPDF lacks SVG sanitization
CVSS
—
EPSS
0.6%
Published
Dec 27, 2024
CISA due date
—
Cloudanix analysis
A PDF creation tool can let attackers slip harmful code into image files so it runs when someone views the resulting document.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Data Exposure
- Component
- Library
- Class
- XSS
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The setSVGStyles method fails to sanitize the font-family attribute in supplied SVG content, permitting injection of arbitrary script payloads that execute in the context of generated output or consuming applications.
Why it matters to the business
Organizations relying on this PDF library risk exposure to unauthorized script execution that can lead to data theft, session compromise, or defacement in any application processing user-supplied SVG files.
How an attack unfolds
An attacker crafts an SVG containing a malicious font-family value with script code, submits it to an application using the vulnerable library, and triggers processing so the payload executes when the output is rendered.
How to fix it
Upgrade tecnickcom/tcpdf to the version containing commit c9f41cbb84880bdb4fc3e0a9d287214d1ac4d7f4 (equivalent to 6.8.0 or newer) and ensure all SVG inputs are processed with the patched library.
How to confirm the fix worked
Confirm the installed library reports version 6.8.0 or later, review the setSVGStyles implementation for font-family sanitization, and test with known malicious SVG samples to verify payload rejection.
Typical attack path
- Locate an application that accepts SVG input and uses TCPDF < 6.8.0
- Craft an SVG document embedding script inside the font-family attribute
- Submit the SVG through the application's normal processing flow
- Trigger PDF generation or rendering of the SVG content
- Execute injected script in the victim's browser context
How to detect it
Search web and application logs for SVG uploads containing font-family attributes with script, style, or event-handler patterns; inspect generated PDF metadata or embedded content for unexpected script fragments.
What your security team should do
- Immediately update all instances of tecnickcom/tcpdf to the fixed commit
- Audit every code path that accepts or renders SVG content
- Add server-side validation to reject suspicious font-family values
- Review recent generated PDFs or outputs for signs of injected content
The record
An issue was discovered in TCPDF before 6.8.0. setSVGStyles does not sanitize the SVG font-family attribute.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Packagist | tecnickcom/tcpdf | 0 | 6.8.0 |
| Debian:11 | tcpdf | 0 | No fix |
| Debian:12 | tcpdf | 0 | No fix |
| Debian:13 | tcpdf | 0 | 6.8.0+dfsg-1 |
| Mageia:9 | php-tcpdf | 0 | 6.5.0-1.3.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: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-56527 TCPDF missing character escape on error messages Also affects tecnickcom/tcpdf
- CVE-2024-56521 TCPDF missing certificate validation Also affects tecnickcom/tcpdf
- CVE-2024-56522 TCPDF has incorrect comparison Also affects tecnickcom/tcpdf
- CVE-2024-51058 TCPDF Local File Inclusion vulnerability Also affects tecnickcom/tcpdf
- CVE-2024-22640 TCPDF version <=6.6.5 is vulnerable to ReDoS (Regular Expression Denial of Service) if… Also affects tecnickcom/tcpdf
- CVE-2024-32489 TCPDF before 6.7.4 mishandles calls that use HTML syntax. Also affects tecnickcom/tcpdf
- 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-22641 TCPDF version 6.6.5 and before is vulnerable to ReDoS (Regular Expression Denial of… Also affects tcpdf