Moderate Vulnerability in TCPDF: Incorrect Comparison in unserializeTCPDFtag

tecnickcom/tcpdf Updated 02 Oct 2025

Summary

27/12/2024
MODERATE
Yes i
Moderate
Not published

GHSA-w95c-7994-ghpr: TCPDF has incorrect comparison. Affects tecnickcom/tcpdf versions < 6.8.0. Fixed in 6.8.0. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

TCPDF is an open-source PHP library that enables the generation of PDF documents directly from PHP scripts. It is widely used for creating dynamic PDF files in web applications. The library supports various features such as text, images, and graphics, making it a versatile tool for developers. However, prior to version 6.8.0, TCPDF contained a vulnerability related to the unserializeTCPDFtag function, which could lead to security issues due to improper comparison methods.

Vulnerability Detail

The vulnerability arises from the use of loose comparison (using !=) 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 logic, leading to unexpected behavior or security breaches. The issue is classified under CWE-697, indicating a problem with incorrect comparison logic that could be leveraged in various attack scenarios.

How To Fix

Minimum fixed version

6.8.0

This is the first release that contains the fix.

composer require tecnickcom/tcpdf:6.8.0

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

Workaround

As a temporary workaround, developers can implement additional validation checks before using the unserializeTCPDFtag function to ensure that the input data is sanitized and does not lead to unintended consequences. However, the best approach is to update to the latest version.

Conclusion

In summary, the TCPDF library has a moderate vulnerability related to incorrect comparison logic in the unserializeTCPDFtag function. It is crucial for developers using this library to update to version 6.8.0 or later to ensure the security of their applications. Temporary workarounds can be implemented, but the best practice is to apply the patch as soon as possible.

See every vulnerability recorded for tecnickcom/tcpdf →

Share this vulnerability

FAQ

The vulnerability involves incorrect comparison logic in the unserializeTCPDFtag function, which could lead to security issues.

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

The risks include unexpected behavior in the application and potential security breaches due to improper handling of TCPDF tag hashes.

Yes, the vulnerability has been patched in TCPDF version 6.8.0 and later.

If immediate updating is not possible, implement additional validation checks as a temporary workaround to mitigate risks.

Related vulnerabilities

Recent vulnerabilities recorded for tecnickcom/tcpdf.

How To Fix

Minimum fixed version

6.8.0

This is the first release that contains the fix.

composer require tecnickcom/tcpdf:6.8.0

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