Vulnerability · Published Nov 15, 2024 · Assigned by @huntr_ai
CVE-2021-3838PHAR Deserialization in dompdf/dompdf
Critical 9.8
In plain English
A critical-severity unsafe deserialization in dompdf/dompdf from dompdf. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 1.4% (higher than 73% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
DomPDF before version 2.0.0 is vulnerable to PHAR deserialization due to a lack of checking on the protocol before passing it into the file_get_contents() function. An attacker who can upload files of any type to the server can pass in the phar:// protocol to unserialize the uploaded file and instantiate arbitrary PHP objects. This can lead to remote code execution, especially when DOMPdf is used with frameworks with documented POP chains like Laravel or vulnerable developer code.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | php-dompdf | 2.0.2+dfsg-1 | DEBIAN-CVE-2021-3838 |
| Packagist | dompdf/dompdf | 2.0.0 | GHSA-577p-7j7h-2jgf |
| Ubuntu:22.04:LTS | php-dompdf | 0.6.2+dfsg-3.1ubuntu0.1 | USN-6277-2 |
| Ubuntu:22.04:LTS | php-dompdf | 0.6.2+dfsg-3.1ubuntu0.1 | UBUNTU-CVE-2021-3838 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| dompdf | dompdf/dompdf | unspecified – before 2.0.0 |
Weakness: CWE-502 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H