GHSA-q386-w6fg-gmgp CVE-2023-38490
XML External Entity (XXE) vulnerability in the XML data handler
- Severity
- 6.8 / 10
- Critical · CVSS 3.1
- Exploit chance (EPSS)
- 1.70%
- Chance of exploitation in the next 30 days. Higher than 77.23% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-611 Improper Restriction of XML External Entity Reference
- Fix
3.5.8.3- Upgrade getkirby/cms to this version or later
Description
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, Kirby 3.6.6.3, Kirby 3.7.5.2, Kirby 3.8.4.1 and Kirby 3.9.6. Please update to one of these or a later version 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 and Patrick Falb (@dapatrese) at FORMER 03 for responsibly reporting the identified issue.
Affected versions
Packagist
| Package | Vulnerable | Fixed in |
|---|---|---|
| getkirby/cms | < 3.5.8.3 |
3.5.8.3 |
| getkirby/cms | >= 3.6.0, < 3.6.6.3 |
3.6.6.3 |
| getkirby/cms | >= 3.7.0, < 3.7.5.2 |
3.7.5.2 |
| getkirby/cms | >= 3.8.0, < 3.8.4.1 |
3.8.4.1 |
| getkirby/cms | >= 3.9.0, < 3.9.6 |
3.9.6 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
getkirby/cms Packagist → 3.5.8.3
- composer
composer require getkirby/cms:^3.5.8.3
Severity breakdown
CVSS 3.1 6.8
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
- Attack vector
- Network
- Attack complexity
- High
- Privileges required
- None
- User interaction
- None
- Scope
- Changed
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Weakness
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 to prevent it
- Implementation, System Configuration: Many XML parsers and validators can be configured to disable external entity expansion.
References
Advisories
Packages
Other links
- github.com/getkirby/kirby/security/advisories/GHSA-q386-w6fg-gmgp
- github.com/getkirby/kirby/commit/277b05662d2b67386f0a0f18323cf68b30e86387
- github.com/getkirby/kirby/releases/tag/3.5.8.3
- github.com/getkirby/kirby/releases/tag/3.6.6.3
- github.com/getkirby/kirby/releases/tag/3.7.5.2
- github.com/getkirby/kirby/releases/tag/3.8.4.1
- github.com/getkirby/kirby/releases/tag/3.9.6
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-9vx2-j98c-p72w Kirby: Access to image files and limited access to JSON files outside of the site root via path traversal in the media handling | High | Also affects getkirby/cms |
| GHSA-6j4c-mgqr-qv76 Kirby: Access to image files outside of the site root via path traversal in the media handling | Medium | Also affects getkirby/cms |
| GHSA-67mx-6wf2-92xp Kirby: File upload permissions are not checked during processing of chunk data | High | Also affects getkirby/cms |
| GHSA-rf2p-vh74-7vvh Kirby: System path exposure from error messages in the REST API | Medium | Also affects getkirby/cms |
| GHSA-r3w8-2c5r-h9j9 Kirby: `pages.access` permission is not checked in the `site/find` REST API route | High | Also affects getkirby/cms |
| GHSA-89cp-7p28-jffg Kirby: Access to files of top-level drafts is not protected by permissions | Medium | Also affects getkirby/cms |
| GHSA-whxw-24jc-cwmv Kirby: External Initialization of the Panel on reverse proxy setups with the `Forwarded` header | Critical | Also affects getkirby/cms |
| GHSA-wr9h-4r83-f4v6 Kirby: Cross-site scripting (XSS) from incomplete HTML/XML sanitization in `Dom::sanitize()` | High | Also affects getkirby/cms |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor