CVE-2021-3838Dompdf Project Dompdf
Critical 9.8 No auth needed
Follow: this CVE · Dompdf Project · Dompdf Project Dompdf We alert you by email or Slack (account required).
- Priority
- 74
- CVSS 3.1
- 9.8
- EPSS
- 1.4% probability of exploitation in 30 days · percentile 73
- Auth required
- No
- Published
- Nov 15, 2024
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-502
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: yes · Technical impact: total
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
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.
What to do
- Apply the vendor's security update for Dompdf.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| Packagist | dompdf/dompdf |
< 2.0.0 |
2.0.0 |
composer require "dompdf/dompdf:^2.0.0" |
Per OSV / GitHub Advisories (GHSA-577p-7j7h-2jgf). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| dompdf_project | dompdf | < 2.0.0 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch
- huntr.com Exploit Issue Tracking Patch