CVE-2023-23924: Dompdf vulnerable to URI validation failure on SVG parsing
Summary
CVE-2023-23924: Dompdf vulnerable to URI validation failure on SVG parsing. Affects dompdf/dompdf versions < 2.0.2. Fixed in 2.0.2. 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
Dompdf is a PHP library that allows users to generate PDF files from HTML content. It is commonly used in web applications to convert HTML pages into printable documents. Dompdf provides various features for styling and formatting the PDF output, making it a popular choice for developers. However, a vulnerability has been discovered in version 2.0.1 of Dompdf that allows for URI validation failure during SVG parsing.
Vulnerability Detail
The vulnerability in Dompdf version 2.0.1 occurs during the parsing of SVG files that contain <image> tags with uppercase letters. The URI validation process fails to detect these tags due to a case-sensitive comparison. This allows an attacker to bypass the validation and potentially exploit the vulnerability. In PHP versions prior to 8.0.0, this can lead to arbitrary object unserialization through the phar URL wrapper, which can result in arbitrary file deletion and potentially remote code execution.
How To Fix
Minimum fixed version
2.0.2
This is the first release that contains the fix.
composer require dompdf/dompdf:2.0.2
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 crucial to upgrade to the fixed version of Dompdf to mitigate the risk of exploitation.
Conclusion
The vulnerability in Dompdf version 2.0.1 allows for URI validation failure during SVG parsing, potentially leading to arbitrary object unserialization and remote code execution. It is crucial to upgrade to version 2.0.2 or later to mitigate the risk of exploitation. For further support on vulnerability remediation, you can 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 is commonly used in web applications to convert HTML pages into printable documents.
The vulnerability allows an attacker to bypass URI validation and potentially exploit the vulnerability. In PHP versions prior to 8.0.0, this can lead to arbitrary object unserialization, which can result in arbitrary file deletion and potentially remote code execution.
To fix this vulnerability, it is recommended to upgrade to version 2.0.2 of Dompdf or later. This version includes a fix for the URI validation failure during SVG parsing.
There are no known workarounds for this vulnerability. Upgrading to the fixed version of Dompdf is the recommended solution.
For more information about this vulnerability, you can refer to the CVE identifier CVE-2023-23924 and the GitHub Security Advisory GHSA-3cw5-7cxw-v5qg.
References
Related vulnerabilities
Recent vulnerabilities recorded for dompdf/dompdf.