Critical Deserialization Vulnerability in TCPDF Package

tcpdf Updated 02 Oct 2025

Summary

14/09/2018
N/A
Yes i
Critical
9.8

CVE-2018-17057: An issue was discovered in TCPDF before 6.2.22. Attackers can trigger deserialization of arbitrary data via the phar:// wrapper. Affects tcpdf across 3 version ranges.

< 1cdd78d27697b3150bb44aaa7af1a81062a591a5 < 6.2.26+dfsg-1 < 1861e33fe05f653b67d070f7c106463e7a5c26ed

Fixed in 6.2.26+dfsg-1. 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 barcodes, making it a versatile tool for developers. However, prior to version 6.2.22, TCPDF was susceptible to a critical vulnerability that allowed attackers to exploit deserialization issues, potentially compromising the integrity of applications using this library.

Vulnerability Detail

The vulnerability, identified as CVE-2018-17057, arises from the improper handling of data deserialization via the phar:// wrapper in TCPDF versions before 6.2.22. Attackers can exploit this flaw to trigger deserialization of arbitrary data, leading to severe consequences such as remote code execution or data manipulation. The vulnerability has a CVSS score of 9.8, indicating its critical nature and the high risk it poses to affected systems.

How To Fix

Minimum fixed version

6.2.26+dfsg-1

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

If immediate upgrading is not feasible, consider implementing input validation and sanitization to mitigate the risk of deserialization attacks. Additionally, avoid using the phar:// wrapper in your application until the upgrade is completed.

Conclusion

The TCPDF vulnerability CVE-2018-17057 poses a significant risk to applications that utilize this library. It is crucial for developers to upgrade to the latest version to mitigate potential threats. By following the recommended steps and utilizing tools like Vulert, developers can ensure their applications remain secure.

See every vulnerability recorded for tcpdf →

Share this vulnerability

FAQ

CVE-2018-17057 is a critical vulnerability in TCPDF that allows attackers to exploit deserialization of arbitrary data via the phar:// wrapper.

TCPDF versions prior to 6.2.22 are affected by this vulnerability.

Exploitation of this vulnerability can lead to remote code execution, data manipulation, and compromise of application integrity.

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

Vulert is a tool that monitors and alerts in real-time for open-source vulnerabilities in software using just a manifest file like package-lock.json.

Related vulnerabilities

Recent vulnerabilities recorded for tcpdf.

How To Fix

Minimum fixed version

6.2.26+dfsg-1

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