Every CVE Search/ Get API key

CVE-2021-3838

PHAR Deserialization in dompdf/dompdf

9.8 CriticalFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

1.43%Up 1.4 points since Nov 16, 2024
90%50%10%1%

What each source reports

CVE List 9.8

PHAR Deserialization in dompdf/dompdf

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.

Record
CVE-2021-3838
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 3.0
9.8 CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-502
Updated
2026-11-02
EUVDEUVD-2024-3197 9.8

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.

Record
EUVD-2024-3197
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-03
GitHub AdvisoriesGHSA-577p-7j7h-2jgf 9.8

Deserialization of Untrusted Data in dompdf/dompdf

DomPDF before version 2.0.0 is vulnerable to PHAR (PHP Archive) 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.

Record
GHSA-577p-7j7h-2jgf
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-502
Updated
2026-11-02
NVD 9.8

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.

Record
CVE-2021-3838
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 3.0
9.8 CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-502
Updated
2026-11-02
OSV 9.8

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.

Record
CVE-2021-3838
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2021-3838 9.8

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.

Record
DEBIAN-CVE-2021-3838
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
Show 6 moreShow less
OSVGHSA-577p-7j7h-2jgf 9.8

Deserialization of Untrusted Data in dompdf/dompdf

DomPDF before version 2.0.0 is vulnerable to PHAR (PHP Archive) 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.

Record
GHSA-577p-7j7h-2jgf
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-502
Updated
2026-11-02
OSVUBUNTU-CVE-2021-3838 9.8

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.

Record
UBUNTU-CVE-2021-3838
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 3.0
9.8 CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVCLSA-2025-1766019429 No score

TuxCare security update for dompdf/dompdf (7 CVEs)

TuxCare rebuilt dompdf/dompdf to address 7 CVEs. Fixed in 1.2.2-p1+tuxcare.

Record
CLSA-2025-1766019429
Updated
2026-11-02
OSVCLSA-2025-1766364765 No score

TuxCare security update for dompdf/dompdf (8 CVEs)

TuxCare rebuilt dompdf/dompdf to address 8 CVEs. Fixed in 0.8.6-p1+tuxcare.

Record
CLSA-2025-1766364765
Updated
2026-11-02
OSVUSN-6277-1 No score

php-dompdf vulnerabilities

It was discovered that Dompdf was not properly validating untrusted input when processing HTML content under certain circumstances. An attacker could possibly use this issue to expose sensitive information or execute arbitrary code. This issue only affected Ubuntu 16.04 LTS. (CVE-2014-5011, CVE-2014-5012, CVE-2014-5013)

It was discovered that Dompdf was not properly validating processed HTML content that referenced PHAR files, which could result in the deserialization of untrusted data. An attacker could possibly use this issue to execute arbitrary code. (CVE-2021-3838)

It was discovered that Dompdf was not properly validating processed HTML content that referenced both a remote base and a local file, which could result in the bypass of a chroot check. An attacker could possibly use this issue to expose sensitive information. (CVE-2022-2400)

Record
USN-6277-1
Updated
2026-11-02
OSVUSN-6277-2 No score

php-dompdf vulnerabilities

USN-6277-1 fixed vulnerabilities in Dompdf. This update provides the corresponding updates for Ubuntu 22.04 LTS.

Original advisory details:

It was discovered that Dompdf was not properly validating untrusted input when processing HTML content under certain circumstances. An attacker could possibly use this issue to expose sensitive information or execute arbitrary code. This issue only affected Ubuntu 16.04 LTS. (CVE-2014-5011, CVE-2014-5012, CVE-2014-5013)

It was discovered that Dompdf was not properly validating processed HTML content that referenced PHAR files, which could result in the deserialization of untrusted data. An attacker could possibly use this issue to execute arbitrary code. (CVE-2021-3838)

It was discovered that Dompdf was not properly validating processed HTML content that referenced both a remote base and a local file, which could result in the bypass of a chroot check. An attacker could possibly use this issue to expose sensitive information. (CVE-2022-2400)

Record
USN-6277-2
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
dompdf/dompdf
Packagist
before 2.0.0
2.0.0
dompdf/dompdf
TuxCare:Packagist
From an advisory covering 7 CVEs
v1.2.2 up to 1.2.2-p1+tuxcare
1.2.2-p1+tuxcare
dompdf/dompdf
TuxCare:Packagist
From an advisory covering 8 CVEs
0.8.6 up to 0.8.6-p1+tuxcare
0.8.6-p1+tuxcare
php-dompdf
Debian:12
before 2.0.2+dfsg-1
2.0.2+dfsg-1
php-dompdf
Debian:10
From an advisory covering 2 CVEs
before 0.6.2+dfsg-3+deb10u1, plus listed versions
0.6.2+dfsg-3
0.6.2+dfsg-3+deb10u1
php-dompdf
Debian:10
before 0.6.2+dfsg-3+deb10u2, plus listed versions
0.6.2+dfsg-30.6.2+dfsg-3+deb10u1
0.6.2+dfsg-3+deb10u2
php-dompdf
Debian:11
From an advisory covering 2 CVEs
before 0.6.2+dfsg-3.1+deb11u1, plus listed versions
0.6.2+dfsg-3.1
0.6.2+dfsg-3.1+deb11u1
dompdf/dompdf
Packagist
before 2.0.0, plus listed versions
v0.6.0v0.6.1v0.6.2v0.7.0v0.7.0-beta
Show 17 moreShow less
v0.7.0-beta2v0.7.0-beta3v0.8.0v0.8.1v0.8.2v0.8.3v0.8.4v0.8.5v0.8.6v1.0.0v1.0.1v1.0.2v1.1.0v1.1.1v1.2.0v1.2.1v1.2.2
2.0.0
php-dompdf
Ubuntu:Pro:16.04:LTS
before 0.6.1+dfsg-2ubuntu1+esm1, plus listed versions
0.6.1+dfsg-20.6.1+dfsg-2build10.6.1+dfsg-2ubuntu1
0.6.1+dfsg-2ubuntu1+esm1
php-dompdf
Ubuntu:Pro:18.04:LTS
before 0.6.2+dfsg-3ubuntu0.18.04.1~esm1, plus listed versions
0.6.2+dfsg-3
0.6.2+dfsg-3ubuntu0.18.04.1~esm1
Show 6 moreShow less
Affected packages
PackageAffectedFixed
php-dompdf
Ubuntu:20.04:LTS
before 0.6.2+dfsg-3ubuntu0.20.04.1, plus listed versions
0.6.2+dfsg-3
0.6.2+dfsg-3ubuntu0.20.04.1
php-dompdf
Ubuntu:22.04:LTS
before 0.6.2+dfsg-3.1ubuntu0.1, plus listed versions
0.6.2+dfsg-3.1
0.6.2+dfsg-3.1ubuntu0.1
php-dompdf
Ubuntu:Pro:16.04:LTS
From an advisory covering 5 CVEs
before 0.6.1+dfsg-2ubuntu1+esm1, plus listed versions
0.6.1+dfsg-20.6.1+dfsg-2build10.6.1+dfsg-2ubuntu1
0.6.1+dfsg-2ubuntu1+esm1
php-dompdf
Ubuntu:Pro:18.04:LTS
From an advisory covering 5 CVEs
before 0.6.2+dfsg-3ubuntu0.18.04.1~esm1, plus listed versions
0.6.2+dfsg-3
0.6.2+dfsg-3ubuntu0.18.04.1~esm1
php-dompdf
Ubuntu:20.04:LTS
From an advisory covering 5 CVEs
before 0.6.2+dfsg-3ubuntu0.20.04.1, plus listed versions
0.6.2+dfsg-3
0.6.2+dfsg-3ubuntu0.20.04.1
php-dompdf
Ubuntu:22.04:LTS
From an advisory covering 2 CVEs
before 0.6.2+dfsg-3.1ubuntu0.1, plus listed versions
0.6.2+dfsg-3.1
0.6.2+dfsg-3.1ubuntu0.1

History

History
RecordedChangedSources
affected, facts
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-3838 is a critical vulnerability (CVSS 9.8) in Dompdf, published February 14, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.43%, the 73rd percentile. Fixed in dompdf/dompdf 2.0.0.

References

Show 10 moreShow less
MoveEnter Open