CyberSecBulletin
CVE-2023-3823NVD status: Modified

PHP: Improper Restriction of XML External Entity Reference

CVE-2023-3823 is a high-severity improper restriction of XML external entity reference vulnerability in PHP from PHP Group, with a CVSS 3.1 base score of 7.5 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists versions 8.0.30, 8.1.22, 8.2.8 as the first without the flaw, so updating PHP to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 1.64% chance of exploitation within 30 days, higher than 77% of scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update PHP to 8.0.30 or 8.1.22 or 8.2.8, whichever matches your release line, or a later version.
  2. Read the advisory on github.com for workarounds and exact fixed builds.
  3. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
PHP GroupPHP8.0.* up to, but not including, 8.0.30; 8.1.* up to, but not including, 8.1.22; 8.2.* up to, but not including, 8.2.88.0.30, 8.1.22, 8.2.8
Fedora ProjectFedora38Not stated
DebianDebian Linux10.0Not stated

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
NoneNo account or login is needed.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
NoneNothing can be modified.
Availability
NoneAvailability is not affected.

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.18.6HighCNA (php.net)
CVSS 3.17.5HighNVD

Official description

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.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Improper Restriction of XML External Entity Reference

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.

How developers prevent this class of flaw

  • Many XML parsers and validators can be configured to disable external entity expansion.

More Improper Restriction of XML External Entity Reference vulnerabilities (CWE-611)

Timeline

  1. CVE record published.
  2. Record last changed materially (score, affected products, status or references).

References

Third-party and government advisories

Other vulnerabilities in PHP

All PHP vulnerabilities

Recent Improper Restriction of XML External Entity Reference vulnerabilities

Spotted an error? Tell us.