Skip to content

CVE-2021-3838 PHAR Deserialization in dompdf/dompdf

CriticalCVSS 9.8 EPSS 1.4%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: yes · technical impact: total
Technology
PHPLaravelUbuntuDebian

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.

Upgrade path

9 packages: 9 fixed.

PackageAffectedFixed inStatus
debian/php-dompdf(Debian 12) < 2.0.2+dfsg-1 2.0.2+dfsg-1 Fixed
dompdf project dompdf < 2.0.0 2.0.0 Fixed
dompdf/dompdf < 2.0.0 2.0.0 Fixed
dompdf/dompdf < 2.0.0 2.0.0 Fixed
dompdf/dompdf(Packagist) < 2.0.0; = v0.6.0; = v0.6.1; = v0.6.2 +19 more 2.0.0 Fixed
ubuntu/php-dompdf(Ubuntu 20.04) < 0.6.2+dfsg-3ubuntu0.20.04.1; = 0.6.2+dfsg-3 0.6.2+dfsg-3ubuntu0.20.04.1 Fixed
ubuntu/php-dompdf(Ubuntu 22.04) < 0.6.2+dfsg-3.1ubuntu0.1; = 0.6.2+dfsg-3.1 0.6.2+dfsg-3.1ubuntu0.1 Fixed
ubuntu/php-dompdf(Ubuntu Pro 16.04) < 0.6.1+dfsg-2ubuntu1+esm1; = 0.6.1+dfsg-2; = 0.6.1+dfsg-2build1; = 0.6.1+dfsg-2ubuntu1 0.6.1+dfsg-2ubuntu1+esm1 Fixed
ubuntu/php-dompdf(Ubuntu Pro 18.04) < 0.6.2+dfsg-3ubuntu0.18.04.1~esm1; = 0.6.2+dfsg-3 0.6.2+dfsg-3ubuntu0.18.04.1~esm1 Fixed

Affected products

ProductAffected versionsFixed in
dompdf/dompdf(Packagist) < 2.0.0 2.0.0
dompdf/dompdf(Packagist) = v0.6.0 No fix listed
dompdf/dompdf(Packagist) = v0.6.1 No fix listed
dompdf/dompdf(Packagist) = v0.6.2 No fix listed
dompdf/dompdf(Packagist) = v0.7.0 No fix listed
dompdf/dompdf(Packagist) = v0.7.0-beta No fix listed
dompdf/dompdf(Packagist) = v0.7.0-beta2 No fix listed
dompdf/dompdf(Packagist) = v0.7.0-beta3 No fix listed
dompdf/dompdf(Packagist) = v0.8.0 No fix listed
dompdf/dompdf(Packagist) = v0.8.1 No fix listed
dompdf/dompdf(Packagist) = v0.8.2 No fix listed
dompdf/dompdf(Packagist) = v0.8.3 No fix listed
dompdf/dompdf(Packagist) = v0.8.4 No fix listed
dompdf/dompdf(Packagist) = v0.8.5 No fix listed
dompdf/dompdf(Packagist) = v0.8.6 No fix listed
dompdf/dompdf(Packagist) = v1.0.0 No fix listed
dompdf/dompdf(Packagist) = v1.0.1 No fix listed
dompdf/dompdf(Packagist) = v1.0.2 No fix listed
dompdf/dompdf(Packagist) = v1.1.0 No fix listed
dompdf/dompdf(Packagist) = v1.1.1 No fix listed
dompdf/dompdf(Packagist) = v1.2.0 No fix listed
dompdf/dompdf(Packagist) = v1.2.1 No fix listed
dompdf/dompdf(Packagist) = v1.2.2 No fix listed
debian/php-dompdf(Debian:12) < 2.0.2+dfsg-1 2.0.2+dfsg-1
ubuntu/php-dompdf(Ubuntu:22.04) < 0.6.2+dfsg-3.1ubuntu0.1 0.6.2+dfsg-3.1ubuntu0.1
Show 11 more
ProductAffected versionsFixed in
dompdf/dompdf < 2.0.0 2.0.0
dompdf project dompdf < 2.0.0 2.0.0
ubuntu/php-dompdf(Ubuntu:Pro:16.04) < 0.6.1+dfsg-2ubuntu1+esm1 0.6.1+dfsg-2ubuntu1+esm1
ubuntu/php-dompdf(Ubuntu:Pro:16.04) = 0.6.1+dfsg-2 No fix listed
ubuntu/php-dompdf(Ubuntu:Pro:16.04) = 0.6.1+dfsg-2build1 No fix listed
ubuntu/php-dompdf(Ubuntu:Pro:16.04) = 0.6.1+dfsg-2ubuntu1 No fix listed
ubuntu/php-dompdf(Ubuntu:Pro:18.04) < 0.6.2+dfsg-3ubuntu0.18.04.1~esm1 0.6.2+dfsg-3ubuntu0.18.04.1~esm1
ubuntu/php-dompdf(Ubuntu:Pro:18.04) = 0.6.2+dfsg-3 No fix listed
ubuntu/php-dompdf(Ubuntu:20.04) < 0.6.2+dfsg-3ubuntu0.20.04.1 0.6.2+dfsg-3ubuntu0.20.04.1
ubuntu/php-dompdf(Ubuntu:20.04) = 0.6.2+dfsg-3 No fix listed
ubuntu/php-dompdf(Ubuntu:22.04) = 0.6.2+dfsg-3.1 No fix listed

References