CVE Vulnerabilities

CVE-2023-3823

Improper Restriction of XML External Entity Reference

Published: Aug 11, 2023 | Modified: Feb 13, 2025
CVSS 3.x
7.5
HIGH
Source:
NVD
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
CVSS 2.x
RedHat/V2
RedHat/V3
7.5 MODERATE
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Ubuntu
MEDIUM
root.io logo minimus.io logo echo.ai logo

In PHP versions 8.0.* before 8.0.30, 8.1.* before 8.1.22, and 8.2.* before 8.2.8 various XML functions rely on libxml global state to track configuration variables, like whether external entities are loaded. This state is assumed to be unchanged unless the user explicitly changes it by calling appropriate function. However, since the state is process-global, other modules - such as ImageMagick - may also use this library within the same process, and change that global state for their internal purposes, and leave it in a state where external entities loading is enabled. This can lead to the situation where external XML is parsed with external entities loaded, which can lead to disclosure of any local files accessible to PHP. This vulnerable state may persist in the same process across many requests, until the process is shut down.

Weakness

The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.

Affected Software

NameVendorStart VersionEnd Version
PhpPhp8.0.0 (including)8.0.30 (excluding)
PhpPhp8.1.0 (including)8.1.22 (excluding)
PhpPhp8.2.0 (including)8.2.9 (excluding)
Red Hat Enterprise Linux 8RedHatphp:8.0-8080020231006102311.0b4eb31d*
Red Hat Enterprise Linux 8RedHatphp:7.4-8100020241113075828.f7998665*
Red Hat Enterprise Linux 9RedHatphp-0:8.0.30-1.el9_2*
Red Hat Enterprise Linux 9RedHatphp:8.1-9030020231221080340.9*
Php5Ubuntuesm-infra-legacy/trusty*
Php5Ubuntutrusty*
Php5Ubuntutrusty/esm*
Php5Ubuntuupstream*
Php7.0Ubuntuesm-infra/xenial*
Php7.0Ubuntuupstream*
Php7.0Ubuntuxenial*
Php7.2Ubuntubionic*
Php7.2Ubuntuesm-infra/bionic*
Php7.2Ubuntuupstream*
Php7.4Ubuntuesm-infra/focal*
Php7.4Ubuntufocal*
Php7.4Ubuntuupstream*
Php8.1Ubuntujammy*
Php8.1Ubuntulunar*
Php8.2Ubuntubionic*
Php8.2Ubuntutrusty*
Php8.2Ubuntuupstream*
Php8.2Ubuntuxenial*

Potential Mitigations

References