CVE-2021-3838
CRITICAL 9.8CVSS 3.1Deserialization of Untrusted Data 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.
- Published
- 15 Nov 2024
- Last modified
- 17 Jun 2026
- Assigned by
- security@huntr.dev
- NVD status
- Analyzed
- Weakness
- CWE-502
- Also known as
- GHSA-577p-7j7h-2jgf
- Sources
- NVDJSONOSV GHSA-577p-7j7h-2jgfJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 134c704f-9b21-4f2e-91b3-4a467353bcc0 (Secondary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | security@huntr.dev (Secondary) | CVSS 3.0 | CRITICAL 9.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | dompdf_project | dompdfcpe:2.3:a:dompdf_project:dompdf:*:*:*:*:*:*:*:* |
< 2.0.0 | 2.0.0 |
| OSV | Packagist | dompdf/dompdf | < 2.0.0 | 2.0.0 |
References
- https://github.com/dompdf/dompdf/commit/99aeec1efec9213e87098d42eb09439e7ee0bb6a · Patch, WEB
- https://huntr.com/bounties/0bdddc12-ff67-4815-ab9f-6011a974f48e · Exploit, Issue Tracking, Patch, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-3838 · ADVISORY
- https://github.com/dompdf/dompdf · PACKAGE
History
- 25 Nov 2026 20:56 UTC · NVD: first stored (published 15 Nov 2024)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 15 Nov 2024)