{"id":"CVE-2021-3838","published":"2024-11-15T10:51:36Z","modified":"2024-11-18T14:41:07Z","title":"PHAR Deserialization in dompdf/dompdf","vendor":"dompdf","product":"dompdf/dompdf","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0142,"percentile":0.73494,"provenance":"source"},"cwes":[{"id":"CWE-502","name":"Deserialization of Untrusted Data"}],"references":[{"url":"https://huntr.com/bounties/0bdddc12-ff67-4815-ab9f-6011a974f48e","tags":[]},{"url":"https://github.com/dompdf/dompdf/commit/99aeec1efec9213e87098d42eb09439e7ee0bb6a","tags":[]}],"priority":{"score":21.6,"factors":[{"name":"EPSS percentile","points":14.7},{"name":"CVSS severity","points":6.86}]},"vendorSlug":"dompdf","affectedVersions":[{"vendor":"dompdf","product":"dompdf/dompdf","versions":[">= unspecified, < 2.0.0"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"total","timestamp":"2024-11-18T14:40:28.381255Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"dompdf/dompdf","vulnerableRanges":["<2.0.0"],"patched":["2.0.0"],"from":["GHSA-577p-7j7h-2jgf"],"provenance":"source"}],"summary":{"text":"The PHAR deserialization flaw affects the dompdf/dompdf PDF rendering library before version 2.0.0, where file_get_contents() is passed an unvalidated protocol, letting phar:// paths trigger unserialization. An attacker who can upload files of any type to the server and reference them via a phar:// path can instantiate arbitrary PHP objects, which can lead to remote code execution, particularly where the library is used alongside frameworks with known POP chains such as Laravel or with vulnerable application code.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:48:22Z"},"euvd":{"id":"EUVD-2024-3197","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-dompdf-dompdf-cve-2022-28368","parents":[{"from":"CVE-2022-28368","to":"CVE-2021-3838","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/FontMetrics.php"],"commits":["https://github.com/dompdf/dompdf/commit/99aeec1efec9213e87098d42eb09439e7ee0bb6a","https://github.com/dompdf/dompdf/commit/4c70e1025bcd9b7694b95dd552499bd83cd6141d"],"basis":"shared function","functions":["registerFont"]}]},{"from":"CVE-2022-0085","to":"CVE-2021-3838","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/Options.php"],"commits":["https://github.com/dompdf/dompdf/commit/99aeec1efec9213e87098d42eb09439e7ee0bb6a","https://github.com/dompdf/dompdf/commit/bb1ef65011a14730b7cfbe73506b4bb8a03704bd"],"basis":"shared function","functions":["__construct"]}]},{"from":"CVE-2022-41343","to":"CVE-2021-3838","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/FontMetrics.php"],"commits":["https://github.com/dompdf/dompdf/commit/99aeec1efec9213e87098d42eb09439e7ee0bb6a","https://github.com/dompdf/dompdf/commit/66431c58017d5b1bdb9f6f772b9fbbc5e3d38dc2"],"basis":"shared function","functions":["registerFont"]}]},{"from":"CVE-2023-50262","to":"CVE-2021-3838","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/Image/Cache.php"],"commits":["https://github.com/dompdf/dompdf/commit/99aeec1efec9213e87098d42eb09439e7ee0bb6a","https://github.com/dompdf/dompdf/commit/41cbac16f3cf56affa49f06e8dae66d0eac2b593"],"basis":"shared function","functions":["Cache","clear"]}]}]}}