{"id":"CVE-2023-23924","aliases":["CVE-2023-23924","GHSA-3cw5-7cxw-v5qg"],"related":[],"kind":"vulnerability","state":"published","title":"URI validation failure on SVG parsing in Dompdf","summary":"Dompdf is an HTML to PDF converter. The URI validation on dompdf 2.0.1 can be bypassed on SVG parsing by passing `<image>` tags with uppercase letters. This may lead to arbitrary object unserialize on PHP < 8, through the `phar` URL wrapper. An attacker can exploit the vulnerability to call arbitrary URL with arbitrary protocols, if they can provide a SVG file to dompdf. In PHP versions before 8.0.0, it leads to arbitrary unserialize, that will lead to the very least to an arbitrary file deletion and even remote code execution, depending on classes that are available.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Dompdf is an HTML to PDF converter. The URI validation on dompdf 2.0.1 can be bypassed on SVG parsing by passing `<image>` tags with uppercase letters. This may lead to arbitrary object unserialize on PHP < 8, through the `phar` URL wrapper. An attacker can exploit the vulnerability to call arbitrary URL with arbitrary protocols, if they can provide a SVG file to dompdf. In PHP versions before 8.0.0, it leads to arbitrary unserialize, that will lead to the very least to an arbitrary file deletion and even remote code execution, depending on classes that are available.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe URI validation on dompdf 2.0.1 can be bypassed on SVG parsing by passing `<image>` tags with uppercase letters. This might leads to arbitrary object unserialize on PHP < 8, through the `phar` URL wrapper.\n\n### Details\nThe bug occurs during SVG parsing of `<image>` tags, in src/Image/Cache.php : \n\n```\nif ($type === \"svg\") {\n    $parser = xml_parser_create(\"utf-8\");\n    xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);\n    xml_set_element_handler(\n        $parser,\n        function ($parser, $name, $attributes) use ($options, $parsed_url, $full_url) {\n            if ($name === \"image\") {\n                $attributes = array_change_key_case($attributes, CASE_LOWER);\n```\nThis part will try to detect `<image>` tags in SVG, and will take the href to validate it against the protocolAllowed whitelist. However, the `$name comparison with \"image\" is case sensitive, which means that such a tag in the SVG will pass : \n\n```\n<svg>\n    <Image xlink:href=\"phar:///foo\"></Image>\n</svg>\n```\n\nAs the tag is named \"Image\" and not \"image\", it will not pass the condition to trigger the check.\n\nA correct solution would be to strtolower the `$name` before the check : \n\n```\nif (strtolower($name) === \"image\") {\n```\n\n### PoC\nParsing the following SVG file is sufficient to reproduce the vulnerability :\n\n```\n<svg>\n    <Image xlink:href=\"phar:///foo\"></Image>\n</svg>\n```\n\n### Impact\nAn attacker might be able to exploit the vulnerability to call arbitrary URL with arbitrary protocols, if they can provide a SVG file to dompdf. In PHP versions before 8.0.0, it leads to arbitrary unserialize, that will leads at the very least to an arbitrary file deletion, and might leads to remote code execution, depending on classes that are available.","format":"markdown","source":"ghsa"}],"published":"2023-01-31T23:54:30.162Z","modified":"2026-09-10T03:49:56.603Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:H","score":10,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:H","score":10,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:H","score":10,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-551","CWE-863"],"affected":[{"ranges":[{"version":"< 2.0.2","status":"affected"}],"vendor":"dompdf","product":"dompdf","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.0.2"}],"ecosystem":"Packagist","package":"dompdf/dompdf","purl":"pkg:composer/dompdf/dompdf","source":"ghsa"},{"ranges":[{"status":"affected","version":"2.0.1"}],"vendor":"dompdf_project","product":"dompdf","cpe":"cpe:2.3:a:dompdf_project:dompdf:2.0.1:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/dompdf/dompdf/security/advisories/GHSA-3cw5-7cxw-v5qg","tags":["exploit","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/dompdf/dompdf/commit/7558f07f693b2ac3266089f21051e6b78c6a0c85","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/dompdf/dompdf/releases/tag/v2.0.2","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-23924","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/dompdf/dompdf/CVE-2023-23924.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-3cw5-7cxw-v5qg","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/dompdf/dompdf","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-03-10T21:02:06.465Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-23924","url":"https://www.cve.org/CVERecord?id=CVE-2023-23924","licence":"CVE Terms of Use","modified":"2025-03-10T21:17:31.944Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3cw5-7cxw-v5qg","url":"https://github.com/advisories/GHSA-3cw5-7cxw-v5qg","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:56.603Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-23924","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-23924","licence":"Public domain","modified":"2026-06-17T05:38:17.923Z"}],"updatedAt":"2026-11-25T22:58:21.781Z","epss":{"score":0.03946,"percentile":0.9068,"date":"2026-12-02T12:00:21.000Z"}}