Cloudanix VulnDB

CVE-2024-56522

None

TCPDF has incorrect comparison

CVSS

—

EPSS

0.6%

Published

Dec 27, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A PDF creation library compared secret values in a way that could let attackers guess them by measuring how long the checks took, risking tampered documents.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
High
Impact
Data Exposure
Component
Library
Class
Cryptographic Weakness
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The vulnerability permits timing side-channel attacks against TCPDF tag hash verification because loose != comparison is used instead of a constant-time equality function.

Why it matters to the business

Attackers could forge valid tags, undermining the integrity of generated PDF documents and potentially bypassing content or access controls in document workflows.

How an attack unfolds

An attacker sends crafted TCPDF tags with varying hash values, measures response timing differences caused by early-exit loose comparison, recovers a valid hash, and then submits a malicious tag that passes verification.

How to fix it

Upgrade tecnickcom/tcpdf to the revision containing commit d54b97cec33f4f1a5ad81119a82085cad93cec89 or later, which replaces loose comparisons with constant-time functions.

How to confirm the fix worked

Confirm the deployed TCPDF source contains the referenced commit; run targeted unit tests that assert constant-time behavior on tag hash comparisons.

Typical attack path

  1. Locate applications using vulnerable TCPDF versions for PDF generation
  2. Send probe requests containing TCPDF tags with guessed or mutated hashes
  3. Measure server response timing to perform statistical timing analysis
  4. Recover a correct tag hash and craft a malicious but accepted tag
  5. Inject the forged tag to alter document content or bypass validation

How to detect it

Inspect application and web server logs for repeated TCPDF tag processing with unusual timing patterns or high volumes of validation attempts; correlate with PDF output anomalies.

What your security team should do

  • Immediately update all instances of tecnickcom/tcpdf to the fixed commit
  • Audit codebases for direct use of unserializeTCPDFtag and similar tag handling
  • Add runtime monitoring for anomalous timing or validation failures in PDF generation paths

The record

An issue was discovered in TCPDF before 6.8.0. unserializeTCPDFtag uses != (aka loose comparison) and does not use a constant-time function to compare TCPDF tag hashes.

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