// For flags

CVE-2023-3823

Security issue with external entity loading in XML without enabling it

Severity Score

7.5
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

1
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

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.

En las versiones de PHP 8.0.* antes de la 8.0.30, 8.1.* antes de la 8.1.22, y 8.2.* antes de la 8.2.8 varias funciones XML se basan en el estado global de libxml para rastrear variables de configuración, como si las entidades externas están cargadas. Se asume que este estado no cambia a menos que el usuario lo cambie explícitamente llamando a la función apropiada. Sin embargo, dado que el estado es global del proceso, otros módulos - como ImageMagick - pueden también usar esta librería dentro del mismo proceso, y cambiar ese estado global para sus propósitos internos, y dejarlo en un estado en el que la carga de entidades externas esté habilitada. Esto puede llevar a la situación donde XML externo es analizado con entidades externas cargadas, lo que puede llevar a la divulgación de cualquier archivo local accesible a PHP. Este estado vulnerable puede persistir en el mismo proceso a través de muchas peticiones, hasta que el proceso sea cerrado.

A flaw was found in PHP due to inadequate validation of user-supplied XML input. By leveraging specially crafted XML code, a remote attacker could obtain sensitive information by viewing the contents of arbitrary files on the system or initiating requests to external systems. This issue may allow unauthorized access to sensitive data and the potential for network scanning of internal and external infrastructure.

*Credits: Joas Schilling
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
Low
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2023-07-21 CVE Reserved
  • 2023-08-11 CVE Published
  • 2024-08-02 CVE Updated
  • 2024-08-02 First Exploit
  • 2024-09-12 EPSS Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-611: Improper Restriction of XML External Entity Reference
CAPEC
  • CAPEC-197: Exponential Data Expansion
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Php
Search vendor "Php"
Php
Search vendor "Php" for product "Php"
>= 8.0.0 < 8.0.30
Search vendor "Php" for product "Php" and version " >= 8.0.0 < 8.0.30"
-
Affected
Php
Search vendor "Php"
Php
Search vendor "Php" for product "Php"
>= 8.1.0 < 8.1.22
Search vendor "Php" for product "Php" and version " >= 8.1.0 < 8.1.22"
-
Affected
Php
Search vendor "Php"
Php
Search vendor "Php" for product "Php"
>= 8.2.0 < 8.2.9
Search vendor "Php" for product "Php" and version " >= 8.2.0 < 8.2.9"
-
Affected
Fedoraproject
Search vendor "Fedoraproject"
Fedora
Search vendor "Fedoraproject" for product "Fedora"
38
Search vendor "Fedoraproject" for product "Fedora" and version "38"
-
Affected
Debian
Search vendor "Debian"
Debian Linux
Search vendor "Debian" for product "Debian Linux"
10.0
Search vendor "Debian" for product "Debian Linux" and version "10.0"
-
Affected