Cloudanix VulnDB

CVE-2024-56519

None

TCPDF lacks SVG sanitization

CVSS

—

EPSS

0.6%

Published

Dec 27, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

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

  1. Locate an application that accepts SVG input and uses TCPDF < 6.8.0
  2. Craft an SVG document embedding script inside the font-family attribute
  3. Submit the SVG through the application's normal processing flow
  4. Trigger PDF generation or rendering of the SVG content
  5. 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