TCPDF Vulnerability CVE-2024-56522: Insecure Hash Comparison in unserializeTCPDFtag

tcpdf Updated 02 Oct 2025

Summary

27/12/2024
N/A
Yes i
Unrated
Not published

CVE-2024-56522: An issue was discovered in TCPDF before 6.8.0. Affects tcpdf across 2 version ranges.

< 6.3.5+dfsg1-1+deb11u1 < d54b97cec33f4f1a5ad81119a82085cad93cec89

Fixed in 6.3.5+dfsg1-1+deb11u1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

TCPDF is a popular open-source PHP library used for generating PDF documents. It provides a wide range of features including support for various fonts, images, and page formats. However, prior to version 6.8.0, TCPDF had a vulnerability in its unserializeTCPDFtag function, which could lead to security issues due to improper hash comparison.

Vulnerability Detail

The vulnerability arises from the use of loose comparison (!=) in the unserializeTCPDFtag function, which does not utilize a constant-time function for comparing TCPDF tag hashes. This can potentially allow an attacker to exploit the comparison mechanism, leading to unauthorized access or manipulation of data. The issue is particularly concerning as it can be exploited in scenarios where user input is processed, making it critical to address.

How To Fix

Minimum fixed version

6.3.5+dfsg1-1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade tcpdf

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using the unserializeTCPDFtag function with untrusted input until the package is updated. Additionally, consider implementing input validation to sanitize any data processed by this function.

Conclusion

In summary, CVE-2024-56522 is a significant vulnerability in the TCPDF library that can lead to security risks due to improper hash comparison. It is crucial for users to update to the latest version to mitigate these risks and ensure the security of their applications.

See every vulnerability recorded for tcpdf →

Share this vulnerability

FAQ

CVE-2024-56522 is a security vulnerability in TCPDF that involves improper hash comparison in the unserializeTCPDFtag function.

TCPDF versions prior to 6.8.0 are affected by this vulnerability.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The risks include unauthorized access and manipulation of data, which can compromise the integrity and security of applications using TCPDF.

Yes, a patch is available in TCPDF version 6.8.0 and later. It is recommended to update to this version or newer.

Related vulnerabilities

Recent vulnerabilities recorded for tcpdf.

How To Fix

Minimum fixed version

6.3.5+dfsg1-1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade tcpdf

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback