CVE-2023-3823
PHP vulnerability analysis and mitigation

Overview

CVE-2023-3823 affects PHP versions 8.0. before 8.0.30, 8.1. before 8.1.22, and 8.2.* before 8.2.8. The vulnerability relates to XML functions relying on libxml global state to track configuration variables, particularly for external entities loading. This vulnerability was discovered by Joas Schilling and Baptista Katapi and was disclosed in August 2023 (PHP Advisory).

Technical details

The vulnerability stems from the way PHP handles libxml global state for configuration variables. While external entities loading is disabled by default, other modules like ImageMagick that use the same library within the same process can change the global state for their internal purposes, potentially leaving external entities loading enabled. The vulnerability has received a CVSS v3.1 base score of 8.6 (High) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L (PHP Advisory).

Impact

When successfully exploited, this vulnerability can lead to the disclosure of any local files accessible to PHP through XML external entity (XXE) processing. The vulnerable state may persist in the same process across many requests until the process is shut down, potentially affecting multiple requests (Debian Advisory).

Mitigation and workarounds

The primary mitigation is to upgrade to PHP versions 8.0.30, 8.1.22, or 8.2.8 or later. As a workaround, applications can set an external entity loader that returns null using: libxmlsetexternalentityloader(function () { return null; }). Note that simply setting the entity loader to null (libxmlsetexternalentityloader(null)) is not sufficient and still leaves the system vulnerable (PHP Advisory).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
David EstlickCISO
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
Adam FletcherChief Security Officer
“We know that if Wiz identifies something as critical, it actually is.”
Greg PoniatowskiHead of Threat and Vulnerability Management