Critical SSL Configuration Vulnerability in TCPDF Package

tcpdf Updated 02 Oct 2025

Summary

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

CVE-2024-56521: An issue was discovered in TCPDF before 6.8.0. If libcurl is used, CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER are set unsafely. Affects tcpdf versions < aab43ab0a824e956276141a28a24c7c0be20f554. No fix is published. 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 Your last release was probably never penetration tested 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 an open-source PHP library that allows users to generate PDF documents directly from PHP code. 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 had a significant vulnerability related to SSL configuration when using libcurl, which could compromise the security of applications relying on this library.

Vulnerability Detail

An issue was discovered in TCPDF before version 6.8.0, where the SSL options CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER were set unsafely when using libcurl. This misconfiguration could allow attackers to perform man-in-the-middle attacks, intercepting and altering communications between the client and server. The vulnerability poses a risk to the confidentiality and integrity of data transmitted over SSL/TLS connections.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If updating the package is not immediately feasible, consider implementing the following workaround:

  1. Review your application code to ensure that CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER are explicitly set to secure values.
  2. Set CURLOPT_SSL_VERIFYHOST to 2 and CURLOPT_SSL_VERIFYPEER to true in your cURL requests.

Example code snippet:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://example.com');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_exec($ch);
curl_close($ch);

Conclusion

The TCPDF package has a critical vulnerability related to SSL configuration when using libcurl, which could expose applications to security risks. It is crucial to update to version 6.8.0 or later to mitigate these risks. If immediate updates are not possible, ensure that SSL options are configured securely in your code.

See every vulnerability recorded for tcpdf →

Share this vulnerability

FAQ

TCPDF is an open-source PHP library used for generating PDF documents from PHP code.

The vulnerability involves unsafe SSL configuration when using libcurl, which can lead to man-in-the-middle attacks.

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

Implement the workaround by ensuring that CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER are set to secure values in your cURL requests.

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

Related vulnerabilities

Recent vulnerabilities recorded for tcpdf.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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