9.8critical
PHAR Deserialization in dompdf/dompdf
- Severity
- 9.8critical CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 1.42% (higher than 73% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- @huntr_ai
- Also known as
- GHSA-577p-7j7h-2jgf
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| dompdf dompdf/dompdf | from unspecified before 2.0.0 | CVE List |
| dompdf dompdf | before 2.0.0 | CVE List |
| dompdf/dompdf (Packagist) | before 2.0.0 | GitHub Advisory Database |
| dompdf_project dompdf | before 2.0.0 | NVD |
All scores
| @huntr_ai | 9.8critical CVSS:3.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| CISA-ADP | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.
What each source says
CVE List
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.
GitHub Advisory Database
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.
NVD (es)
DomPDF anterior a la versión 2.0.0 es vulnerable a la deserialización de PHAR debido a la falta de verificación del protocolo antes de pasarlo a la función file_get_contents(). Un atacante que pueda cargar archivos de cualquier tipo al servidor puede pasar el protocolo phar:// para deserializar el archivo cargado y crear instancias de objetos PHP arbitrarios. Esto puede provocar la ejecución remota de código, especialmente cuando DOMPdf se utiliza con marcos con cadenas POP documentadas como Laravel o código de desarrollador vulnerable.
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-3838 changed 2024-11-18 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-577p-7j7h-2jgf changed 2024-11-18 | CC-BY-4.0 |
| NVD | CVE-2021-3838 changed 2026-06-17 | Public domain |