CVE-2021-3838
JSON

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 packageVersionsReported by
dompdf dompdf/dompdffrom unspecified before 2.0.0CVE List
dompdf dompdfbefore 2.0.0CVE List
dompdf/dompdf (Packagist)before 2.0.0GitHub Advisory Database
dompdf_project dompdfbefore 2.0.0NVD

All scores

@huntr_ai9.8critical CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CISA-ADP9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-502

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

Sources

SourceRecordLicence
CVE ListCVE-2021-3838 changed 2024-11-18CVE Terms of Use
GitHub Advisory DatabaseGHSA-577p-7j7h-2jgf changed 2024-11-18CC-BY-4.0
NVDCVE-2021-3838 changed 2026-06-17Public domain