cbcvebase.
CVE-2023-24813
published 2023-02-07

CVE-2023-24813: Dompdf is an HTML to PDF converter written in php. Due to the difference in the attribute parser of Dompdf and php-svg-lib, an attacker can still call…

PriorityP262critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
EPSS
2.49%
82.6th percentile
Dompdf is an HTML to PDF converter written in php. Due to the difference in the attribute parser of Dompdf and php-svg-lib, an attacker can still call arbitrary URLs with arbitrary protocols. Dompdf parses the href attribute of `image` tags and respects `xlink:href` even if `href` is specified. However, php-svg-lib, which is later used to parse the svg file, parses the href attribute. Since `href` is respected if both `xlink:href` and `href` is specified, it's possible to bypass the protection on the Dompdf side by providing an empty `xlink:href` attribute. An attacker can exploit the vulnerability to call arbitrary URLs with arbitrary protocols if they provide an SVG file to the Dompdf. In PHP versions before 8.0.0, it leads to arbitrary unserialize, which will lead, at the very least, to arbitrary file deletion and might lead to remote code execution, depending on available classes. This vulnerability has been addressed in commit `95009ea98` which has been included in release version 2.0.3. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Affected

3 ranges
VendorProductVersion rangeFixed in
debianphp-dompdf< php-dompdf 2.0.3+dfsg-1 (bookworm)php-dompdf 2.0.3+dfsg-1 (bookworm)
dompdfdompdf>= 2.0.2 < 2.0.32.0.3
dompdf_projectdompdf

Detection & IOCsextracted from sources · hover to see the quote

  • Dompdf SVG href bypass: attacker supplies an SVG with both `xlink:href` (empty) and `href` attributes on an `image` tag; Dompdf sees the empty xlink:href and allows the request, while php-svg-lib later resolves the non-empty `href` to an arbitrary URL/protocol
  • Monitor for SVG files submitted to Dompdf that contain `image` tags with both `xlink:href` and `href` attributes, especially where `xlink:href` is empty and `href` references an external or non-HTTP(S) URL/protocol
  • On PHP < 8.0.0, successful exploitation can trigger arbitrary unserialize via the fetched resource, leading to arbitrary file deletion or RCE; prioritize detection on hosts running PHP < 8.0.0
  • Fix is in Dompdf commit 95009ea98 (release 2.0.3); systems running Dompdf < 2.0.3 should be treated as vulnerable and monitored for SVG-based SSRF/unserialize activity
  • ·Arbitrary protocol SSRF is possible regardless of PHP version; the unserialize/RCE escalation path only applies to PHP < 8.0.0
  • ·There are no known workarounds; the only remediation is upgrading Dompdf to version 2.0.3 or later

CVSS provenance

nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
ghsa9.8CRITICAL
osv9.8CRITICAL
vendor_debian10.0CRITICAL
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.