Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2023-24813 — dompdf

🔴 CVSS 10.0 — Critical ⚠️ Exploit Public CWE-436 NVD
10.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

URI validation failure on SVG parsing. Bypass of CVE-2023-23924

Summary

Due to the difference in the attribute parser of Dompdf and php-svg-lib, an attacker can still call arbitrary URLs with arbitrary protocols.

Details

Dompdf parses the href attribute of image tags with the following code:

[src/Image/Cache.php line 135-150](https://github.com/dompdf/dompdf/blob/2a8a6b80fcaa5148ace50f35a10979fe00c6a35d/src/Image/Cache.php#L135-L150)

``` php

function ($parser, $name, $attributes) use ($options, $parsed_url, $full_url) {

if (strtolower($name) === "image") {

$attributes = array_change_key_case($attributes, CASE_LOWER);

$url = $attributes["xlink:href"] ?? $attributes["href"];

if (!empty($url)) {

$inner_full_url = Helpers::build_url($parsed_url["protocol"], $parsed_url["host"], $parsed_url["path"], $url);

if ($inner_full_url === $full_url) {

throw new ImageException("SVG self-reference is not allowed", E_WARNING);

}

[$resolved_url, $type, $message] = self::resolve_url($url, $parsed_url["protocol"], $parsed_url["host"], $parsed_url["path"], $options);

if (!empty($message)) {

throw new ImageException("This SVG document references a restricted resource. $message", E_WARNING);

}

}

}

},

```

As you can see from the code snippet above, it respects xlink:href even if href is specified.

``` php

$url = $attributes["xlink:href"] ?? $attributes["href"];

```

However, php-svg-lib, which is later used to parse the svg file, parses the href attribute with the following code:

[src/Svg/Tag/Image.php line 51-57](https://github.com/dompdf/php-svg-lib/blob/76876c6cf3080bcb6f249d7d59705108166a6685/src/Svg/Tag/Image.php#L51-L57)

``` php

if (isset($attributes['xlink:href'])) {

$this->href = $attributes['xlink:href'];

}

if (isset($attributes['href'])) {

$this->href = $attributes['href'];

}

```

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.

Impact

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.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity high, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

CVE-2023-24813 is classified as CWE-436: Interpretation Conflict. Two components parse the same data differently, so a check in one is bypassed in the other.

Affected software

CVE-2023-24813 is recorded against 2 packages.

  • dompdf
  • dompdf/dompdf (from 2.0.2 up to 2.0.3)

Timeline and source

Published on 7 February 2023 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from NVD.

References

github.com
github.com
github.com
github.com

Other advisories for this package

dompdf has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-436: Interpretation Conflict) in other software:

CVE-2023-24813 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity CRITICAL
CVSS Score 10.0
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
CWE CWE-436
Public Exploit ⚠️ Yes
Source NVD
Published 2023-02-07
Updated 2026-08-20
Modified 2026-06-17

Affected Packages

Software From version Fixed in
dompdf — —
dompdf/dompdf 2.0.2 2.0.3

Exploit Protection

Are you running dompdf?

CVE-2023-24813 carries CVSS 10.0 Critical rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2023-24813 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2023
✓