# CVE-2021-3838: PHAR Deserialization in dompdf/dompdf

- Severity: Critical 9.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.42%, higher than 73% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-11-15T10:51:36.766Z
- Modified: 2026-06-17T04:05:52.130Z
- Also known as: GHSA-577p-7j7h-2jgf
- Weaknesses: CWE-502
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- Assigned by: @huntr_ai

## 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.

(As written by CVE List.)

## Affected

- dompdf dompdf/dompdf: from unspecified before 2.0.0
- dompdf dompdf: before 2.0.0
- dompdf/dompdf (Packagist): before 2.0.0
- dompdf_project dompdf: before 2.0.0

## Every score

- @huntr_ai: CVSS:3.0 9.8 Critical `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- CISA-ADP: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://huntr.com/bounties/0bdddc12-ff67-4815-ab9f-6011a974f48e> (exploit, issue-tracking, patch, third-party-advisory, web)
- <https://github.com/dompdf/dompdf/commit/99aeec1efec9213e87098d42eb09439e7ee0bb6a> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-3838> (advisory)
- <https://github.com/dompdf/dompdf> (package)

## Sources

- CVE List: [CVE-2021-3838](https://www.cve.org/CVERecord?id=CVE-2021-3838), CVE Terms of Use, modified 2024-11-18
- GitHub Advisory Database: [GHSA-577p-7j7h-2jgf](https://github.com/advisories/GHSA-577p-7j7h-2jgf), CC-BY-4.0, modified 2024-11-18
- NVD: [CVE-2021-3838](https://nvd.nist.gov/vuln/detail/CVE-2021-3838), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-3838 · Whole record: https://cve.day/CVE-2021-3838.json · Rebuilt by cve.day 2026-11-25T22:58:08.964Z
