Font Handling Vulnerability in TCPDF Package - CVE-2024-56520
Summary
CVE-2024-56520: An issue was discovered in tc-lib-pdf-font before 2.6.4, as used in TCPDF before 6.8.0 and other products. Affects tcpdf across 3 version ranges.
< 6.3.5+dfsg1-1+deb11u1
< 30012e333ae611c514ec2dc7cb370bbf4da4e677
< a0a02efe487cc39bd5223359e916dbeafb5cd6fe
Fixed in 6.3.5+dfsg1-1+deb11u1. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
TCPDF is a popular PHP library for generating PDF documents. It supports various features such as text, images, and graphics, making it a versatile tool for developers. However, it relies on external font libraries, which can introduce vulnerabilities if not properly managed. The vulnerability in question affects the handling of font data, specifically Type 1 and TrueType fonts, leading to potential misparsing issues.
Vulnerability Detail
CVE-2024-56520 is a vulnerability found in the tc-lib-pdf-font library, which is used by TCPDF. The issue arises from the mishandling of font data, particularly the FontBBox attribute for Type 1 and TrueType fonts. This misparsing can lead to incorrect rendering of PDF documents, potentially exposing sensitive information or causing application crashes. The vulnerability affects multiple versions of TCPDF and can be exploited if an attacker manipulates font data.
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, you can avoid using Type 1 and TrueType fonts in your PDF generation until the package is updated. Consider using alternative font formats that are not affected by this vulnerability.
Conclusion
CVE-2024-56520 highlights a significant vulnerability in the TCPDF package related to font handling. It is crucial for developers to update their TCPDF installations to the latest version to mitigate risks associated with this vulnerability. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.
See every vulnerability recorded for tcpdf →
FAQ
CVE-2024-56520 is a vulnerability related to the mishandling of font data in the TCPDF library, which can lead to misparsed font attributes.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The risks include incorrect rendering of PDF documents, potential exposure of sensitive information, and application crashes.
Yes, a patch is available in TCPDF version 6.8.0+dfsg-1 and later. Updating to this version will resolve the vulnerability.
If you cannot update the package right away, consider using alternative font formats and monitor your application for any unusual behavior.
References
Related vulnerabilities
Recent vulnerabilities recorded for tcpdf.