Cloudanix VulnDB

CVE-2024-51058

Medium · 6.2

TCPDF Local File Inclusion vulnerability

CVSS

6.2

EPSS

0.8%

Published

Nov 26, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A problem in software that creates PDF files could let attackers steal private information from the server by making the software include secret files in the documents it produces.

Exploitation
Remote Authenticated
Attacker needs
Low Privilege
Complexity
Moderate
Impact
Data Exposure
Component
Library
Class
Path Traversal
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The vulnerability allows reading arbitrary server files through manipulation of the src attribute in img tags processed by the TCPDF library during PDF generation.

Why it matters to the business

Attackers could access sensitive configuration files, credentials, or other data stored on the server, leading to further compromise or data breaches. The library is widely used, increasing potential impact.

How an attack unfolds

An attacker supplies crafted HTML containing an img tag with a src pointing to a local file path like file:///etc/passwd, which TCPDF includes in the generated PDF, exposing the file contents.

How to fix it

Upgrade to the fixed version in commit bfa7d2b6d455ebf72ebe3d48fbd487ee5a1f6f3b of tecnickcom/tcpdf.

How to confirm the fix worked

Verify the library version is updated to include the fix commit, and test that local file paths in img src are no longer included.

Typical attack path

  1. Identify an application using TCPDF to generate PDFs from user-controlled HTML
  2. Craft malicious HTML with img src set to local file path
  3. Trigger PDF generation
  4. Retrieve the PDF containing the file contents

How to detect it

Look for PDF generation logs or requests that include suspicious image sources pointing to local paths; check generated PDFs for unexpected content from system files.

What your security team should do

  • Update TCPDF to the latest fixed version immediately
  • Review applications using TCPDF for user-controlled input in PDF generation
  • Implement input sanitization for HTML content
  • Monitor for unusual PDF generation requests

The record

Local File Inclusion (LFI) vulnerability has been discovered in TCPDF 6.7.5. This vulnerability enables a user to read arbitrary files from the server's file system through <img> src tag, potentially exposing sensitive information.

Affected packages

Ecosystem Package Introduced Fixed
Packagist tecnickcom/tcpdf 0 6.7.6
Debian:11 tcpdf 0 No fix
Debian:12 tcpdf 0 No fix
Debian:13 tcpdf 0 6.7.7+dfsg-1
Debian:14 tcpdf 0 6.7.7+dfsg-1
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