Cloudanix VulnDB

CVE-2024-56527

None

TCPDF missing character escape on error messages

CVSS

—

EPSS

0.8%

Published

Dec 27, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A PDF creation tool did not properly clean up error messages, allowing attackers to potentially run malicious code in users' browsers when those errors appear.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Other
Component
Library
Class
XSS
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The Error function in TCPDF outputs error messages without applying htmlspecialchars, allowing unescaped user-controlled input to be rendered in HTML contexts and enabling reflected or stored cross-site scripting.

Why it matters to the business

Attackers could hijack user sessions, steal sensitive data displayed in PDF generation workflows, or perform actions on behalf of authenticated users who view error pages, increasing risk of data exposure in document-processing applications.

How an attack unfolds

An attacker supplies crafted input that triggers an error path in TCPDF; the unsanitized message containing script tags is echoed directly into the response, executing in the victim's browser when the error page is viewed.

How to fix it

Upgrade tecnickcom/tcpdf to the commit 11778aaa2d9e30a9ae1c1ee97ff349344f0ad6e1 or later (version 6.8.0+). Apply input validation and escaping on all error paths until the library is updated; restrict error message verbosity in production.

How to confirm the fix worked

Confirm the installed version is at or after commit 11778aaa2d9e30a9ae1c1ee97ff349344f0ad6e1; test by triggering known error conditions with script payloads and verify that output is escaped; review source for htmlspecialchars usage around error messages.

Typical attack path

  1. Identify an endpoint or API call that invokes TCPDF and can be forced into an error state with attacker-controlled parameters.
  2. Craft input containing HTML/JS payloads that will be passed to the Error function.
  3. Trigger the error condition so the unsanitized message is returned in an HTML response.
  4. Deliver the link or induce a victim to trigger the error page in a browser context.
  5. Execute arbitrary scripts in the victim's session for data theft or further attacks.

How to detect it

Review web server and application logs for requests that trigger TCPDF errors followed by responses containing script tags or unexpected HTML entities; inspect any user-supplied parameters logged near error events for suspicious payloads.

What your security team should do

  • Immediately update all instances of tecnickcom/tcpdf to the fixed commit or 6.8.0 release.
  • Scan dependency manifests for older versions and prioritize patching in any PDF-generation pipelines.
  • Add WAF rules or output encoding layers as temporary defense for error endpoints.
  • Monitor application logs for unexpected HTML/JS in error contexts until remediation is complete.

The record

An issue was discovered in TCPDF before 6.8.0. The Error function lacks an htmlspecialchars call for the error message.

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