CVE-2023-38490: Getkirby/cms XML External Entity (XXE) Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-q386-w6fg-gmgp
CVSS 6.8
CWE-611
Published
Advisory Summary

CVE-2023-38490 is a MODERATE (CVSS 6.8) xml external entity (xxe) vulnerability vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Getkirby/cms libraries in the Packagist ecosystem. The issue involves xml external entity (xxe) vulnerability in the xml data handler. Remediation is available by upgrading affected packages to version 3.5.8.3, 3.6.6.3, 3.7.5.2, 3.8.4.1, 3.9.6.

CVE-2023-38490 at a Glance

CVE Identifier CVE-2023-38490
GHSA Identifier GHSA-q386-w6fg-gmgp
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Getkirby/cms
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2023-38490

To remediate this vulnerability, upgrade all affected Getkirby/cms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

getkirby/cms fixed: 3.5.8.3
Upgrade getkirby/cms to 3.5.8.3
getkirby/cms fixed: 3.6.6.3
Upgrade getkirby/cms to 3.6.6.3
getkirby/cms fixed: 3.7.5.2
Upgrade getkirby/cms to 3.7.5.2
getkirby/cms fixed: 3.8.4.1
Upgrade getkirby/cms to 3.8.4.1
getkirby/cms fixed: 3.9.6
Upgrade getkirby/cms to 3.9.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for getkirby/cms

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-38490, inspect your project dependencies for Getkirby/cms:

inspect dependencies for getkirby/cms

Analyze the terminal output to locate any version of Getkirby/cms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.5.8.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-611: Improper Restriction of XML External Entity Reference, where 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. In Getkirby/cms, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### TL;DR This vulnerability only affects Kirby sites that use the `Xml` data handler (e.g. `Data::decode($string, 'xml')`) or the `Xml::parse()` method in site or plugin code. The Kirby core does not use any of the affected methods. If you use an affected method and cannot rule out XML input controlled by an attacker, we strongly recommend to update to a patch release. ---- ### Introduction XML External Entities (XXE) is a little used feature in the XML markup language that allows to include data from external files in an XML structure. If the name of the external file can be controlled by an attacker, this becomes a vulnerability that can be abused for various system impacts like the disclosure of internal or confidential data that is stored on the server (arbitrary file disclosure) or to perform network requests on behalf of the server (server-side request forgery, SSRF). ### Impact Kirby's `Xml::parse()` method used PHP's `LIBXML_NOENT` constant, which enabled the processing of XML external entities during the parsing operation. The `Xml::parse()` method is used in the `Xml` data handler (e.g. `Data::decode($string, 'xml')`). Both the vulnerable method and the data handler are not used in the Kirby core. However they may be used in site or plugin code, e.g. to parse RSS feeds or other XML files. If those files are of an external origin (e.g. uploaded by a user or retrieved from an external URL), attackers may be able to include an external entity in the XML file that will then be processed in the parsing process. Kirby sites that don't use XML parsing in site or plugin code are *not* affected. ### Patches The problem has been patched in [Kirby 3.5.8.3](https://github.com/getkirby/kirby/releases/tag/3.5.8.3), [Kirby 3.6.6.3](https://github.com/getkirby/kirby/releases/tag/3.6.6.3), [Kirby 3.7.5.2](https://github.com/getkirby/kirby/releases/tag/3.7.5.2), [Kirby 3.8.4.1](https://github.com/getkirby/kirby/releases/tag/3.8.4.1) and [Kirby 3.9.6](https://github.com/getkirby/kirby/releases/tag/3.9.6). Please update to one of these or a [later version](https://github.com/getkirby/kirby/releases) to fix the vulnerability. In all of the mentioned releases, we have removed the `LIBXML_NOENT` constant as processing of external entities is out of scope of the parsing logic. This protects all uses of the method against the described vulnerability. ### Credits Thanks to Alexandre Zanni (@noraj) at [ACCEIS](https://www.acceis.fr/) and Patrick Falb (@dapatrese) at [FORMER 03](https://former03.de/) for responsibly reporting the identified issue.

CVE-2023-38490 Affected Getkirby/cms Versions

5 component(s)
Fixed Versions:
3.5.8.33.6.6.33.7.5.23.8.4.13.9.6
Product / Package Ecosystem Affected Versions Fixed Version
getkirby/cms
Packagist
< 3.5.8.3
3.5.8.3
getkirby/cms
Packagist
≥ 3.6.0
< 3.6.6.3
3.6.6.3
getkirby/cms
Packagist
≥ 3.7.0
< 3.7.5.2
3.7.5.2
getkirby/cms
Packagist
≥ 3.8.0
< 3.8.4.1
3.8.4.1
getkirby/cms
Packagist
≥ 3.9.0
< 3.9.6
3.9.6

References

Frequently Asked Questions

What is CVE-2023-38490?
CVE-2023-38490 is a security vulnerability in Getkirby/cms involving XML External Entity (XXE) vulnerability in the XML data handler under CWE-611: Improper Restriction of XML External Entity Reference.
Which Getkirby/cms versions are affected?
Affected versions include releases prior to 3.5.8.3, 3.6.6.3, 3.7.5.2, 3.8.4.1, 3.9.6 across affected packages: getkirby/cms.
What version fixes CVE-2023-38490?
Upgrading to 3.5.8.3, 3.6.6.3, 3.7.5.2, 3.8.4.1, 3.9.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is getkirby/cms affected?
Yes, getkirby/cms is affected in releases prior to 3.5.8.3, 3.6.6.3, 3.7.5.2, 3.8.4.1, 3.9.6. Upgrade your dependency to 3.5.8.3, 3.6.6.3, 3.7.5.2, 3.8.4.1, 3.9.6 or later.
What is the CVSS score of CVE-2023-38490?
CVE-2023-38490 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2023-38490?
CVE-2023-38490 is classified under CWE-611: 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 can I check Packagist dependencies for CVE-2023-38490?
Run the dependency tree command: 'inspect dependencies for getkirby/cms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-q386-w6fg-gmgp",
  "modified" : "2023-07-28T15:35:04Z",
  "published" : "2023-07-28T15:35:04Z",
  "aliases" : [ "CVE-2023-38490" ],
  "summary" : "XML External Entity (XXE) vulnerability in the XML data handler",
  "details" : "### TL;DR\n\nThis vulnerability only affects Kirby sites that use the `Xml` data handler (e.g. `Data::decode($string, 'xml')`) or the `Xml::parse()` method in site or plugin code. The Kirby core does not use any of the affected methods.\n\nIf you use an affected method and cannot rule out XML input controlled by an attacker, we strongly recommend to update to a patch release.\n\n----\n\n### Introduction\n\nXML External Entities (XXE) is a little used feature in the XML markup language that allows to include data from external files in an XML structure. If the name of the external file can be controlled by an attacker, this becomes a vulnerability that can be abused for various system impacts like the disclosure of internal or confidential data that is stored on the server (arbitrary file disclosure) or to perform network requests on behalf of the server (server-side request forgery, SSRF).\n\n### Impact\n\nKirby's `Xml::parse()` method used PHP's `LIBXML_NOENT` constant, which enabled the processing of XML external entities during the parsing operation.\n\nThe `Xml::parse()` method is used in the `Xml` data handler (e.g. `Data::decode($string, 'xml')`).\n\nBoth the vulnerable method and the data handler are not used in the Kirby core. However they may be used in site or plugin code, e.g. to parse RSS feeds or other XML files. If those files are of an external origin (e.g. uploaded by a user or retrieved from an external URL), attackers may be able to include an external entity in the XML file that will then be processed in the parsing process.\n\nKirby sites that don't use XML parsing in site or plugin code are *not* affected.\n\n### Patches\n\nThe problem has been patched in [Kirby 3.5.8.3](https://github.com/getkirby/kirby/releases/tag/3.5.8.3), [Kirby 3.6.6.3](https://github.com/getkirby/kirby/releases/tag/3.6.6.3), [Kirby 3.7.5.2](https://github.com/getkirby/kirby/releases/tag/3.7.5.2), [Kirby 3.8.4.1](https://github.com/getkirby/kirby/releases/tag/3.8.4.1) and [Kirby 3.9.6](https://github.com/getkirby/kirby/releases/tag/3.9.6). Please update to one of these or a [later version](https://github.com/getkirby/kirby/releases) to fix the vulnerability.\n\nIn all of the mentioned releases, we have removed the `LIBXML_NOENT` constant as processing of external entities is out of scope of the parsing logic. This protects all uses of the method against the described vulnerability.\n\n### Credits\n\nThanks to Alexandre Zanni (@noraj) at [ACCEIS](https://www.acceis.fr/) and Patrick Falb (@dapatrese) at [FORMER 03](https://former03.de/) for responsibly reporting the identified issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getkirby/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.5.8.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getkirby/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.6.0"
      }, {
        "fixed" : "3.6.6.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getkirby/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.7.0"
      }, {
        "fixed" : "3.7.5.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getkirby/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.8.0"
      }, {
        "fixed" : "3.8.4.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getkirby/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.9.0"
      }, {
        "fixed" : "3.9.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/getkirby/kirby/security/advisories/GHSA-q386-w6fg-gmgp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-38490"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getkirby/kirby/commit/277b05662d2b67386f0a0f18323cf68b30e86387"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/getkirby/kirby"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getkirby/kirby/releases/tag/3.5.8.3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getkirby/kirby/releases/tag/3.6.6.3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getkirby/kirby/releases/tag/3.7.5.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getkirby/kirby/releases/tag/3.8.4.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getkirby/kirby/releases/tag/3.9.6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-28T15:35:04Z",
    "nvd_published_at" : "2023-07-27T15:15:12Z"
  }
}