CVE-2023-38490

Kirby XML External Entity (XXE) vulnerability in the XML data handler

6.8 medium EPSS 1.70%

Published 27 Jul 2023 Updated 16 Oct 2024 CNA: GitHub_M

Check your servers for CVE-2023-38490

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2023-38490 affects kirby, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

Kirby is a content management system. A vulnerability in versions prior to 3.5.8.3, 3.6.6.3, 3.7.5.2, 3.8.4.1, and 3.9.6 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.

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).

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.

The problem has been patched in Kirby 3.5.8.3, 3.6.6.3, 3.7.5.2, 3.8.4.1, and 3.9.6. In all of the mentioned releases, the maintainers 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.

Severity (CVSS)

6.8 medium CVSS 3.1 from GitHub_M (CNA)
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
Attack vector
network: an attacker can reach the vulnerable part over the network, often from the internet
Attack complexity
high: an attack depends on conditions outside the control of the attacker, such as a race
Privileges required
none: the attacker does not need an account
User interaction
none: nobody has to click or open anything
Scope
changed: the damage reaches other components, such as the host of a container or other users
Impact
confidentiality high, integrity none, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 1.70%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 77.9% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 16 Oct 2024):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Weakness

  • CWE-611 Improper Restriction of XML External Entity Reference
  • CWE-776 Improper Restriction of Recursive Entity References in DTDs

Affected products

As the CNA lists them.

ProductVersions
kirby
affected < 3.5.8.3
affected >= 3.6.0, < 3.6.6.3
affected >= 3.7.0, < 3.7.5.2
affected >= 3.8.0, < 3.8.41
affected >= 3.9.0, < 3.9.6

Is my server affected?

Find the installed version of kirby and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i kirby
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2023-38490 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2023-38490

RHEL, Rocky, Alma, Fedora

rpm -q kirby
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2023-38490

Alpine

apk list --installed | grep -i kirby

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2023-38490
trivy image --scanners vuln IMAGE | grep CVE-2023-38490

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Advisories

Other references

Source: the record CVE-2023-38490 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.