CVE-2022-2400: Dompdf chroot check bypass vulnerability
Summary
CVE-2022-2400: Dompdf before v2.0.0 vulnerable to chroot check bypass. Affects dompdf/dompdf versions < 2.0.0. Fixed in 2.0.0. How to fix ↓
Also tracked for
- php-dompdf · Debian:11
The same CVE-2022-2400 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
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
Dompdf is a PHP library that allows users to generate PDF files from HTML content. It is commonly used in web applications to dynamically create and serve PDF documents. The library provides various features for styling and formatting the PDF output, making it a popular choice for generating printable documents. However, versions prior to 2.0.0 are vulnerable to a chroot check bypass, which can lead to the disclosure of PNG and JPEG files.
Vulnerability Detail
The chroot check bypass vulnerability in Dompdf allows an attacker to access PNG and JPEG files that should be restricted due to the chroot environment. By exploiting this vulnerability, an attacker can gain unauthorized access to sensitive files, potentially leading to information disclosure. The vulnerability arises from a flaw in the chroot check implementation, which fails to properly validate file paths and allows access to files outside the intended scope.
How To Fix
Minimum fixed version
2.0.0
This is the first release that contains the fix.
composer require dompdf/dompdf:2.0.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is essential to update to the patched version of Dompdf to mitigate the risk of exploitation.
Conclusion
The chroot check bypass vulnerability in Dompdf can lead to the unauthorized disclosure of PNG and JPEG files. It is crucial to upgrade to Dompdf version 2.0.0 or later to mitigate this risk. Additionally, developers should review their application's file access controls to ensure the protection of sensitive files. For further assistance with vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for dompdf/dompdf →
FAQ
Dompdf is a PHP library used for generating PDF files from HTML content. It provides a convenient way to create printable documents dynamically.
The vulnerability allows unauthorized access to PNG and JPEG files, potentially leading to the disclosure of sensitive information.
To fix this vulnerability, you should upgrade to Dompdf version 2.0.0 or later. Make sure to update your application's dependencies and review file access controls.
No, there is no known workaround for this vulnerability. Updating to the patched version is the recommended solution.
You can find more information about this vulnerability in the Dompdf advisory on GitHub: [link to advisory]
Related vulnerabilities
Recent vulnerabilities recorded for dompdf/dompdf.