CVE-2022-24898: Xwiki commons xml Xwiki-commons-xml Vulnerability

MODERATE
Advisory Identifier: GHSA-m2r5-4w96-qxg5
CVSS 4.9
CWE-611
Published
Advisory Summary

CVE-2022-24898 is a MODERATE (CVSS 4.9) xwiki-commons-xml vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Xwiki commons xml libraries in the Maven ecosystem. The issue involves xwiki-commons-xml. Remediation is available by upgrading affected packages to version 12.10.10, 13.4.4, 13.8-rc-1.

CVE-2022-24898 at a Glance

CVE Identifier CVE-2022-24898
GHSA Identifier GHSA-m2r5-4w96-qxg5
Severity MODERATE
CVSS v3.1 Base Score 4.9
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Xwiki commons xml
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 4.9

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

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

How to Fix CVE-2022-24898

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

org.xwiki.commons:xwiki-commons-xml fixed: 12.10.10
<dependency>
    <groupId>org.xwiki.commons</groupId>
    <artifactId>xwiki-commons-xml</artifactId>
    <version>12.10.10</version>
</dependency>
org.xwiki.commons:xwiki-commons-xml fixed: 13.4.4
<dependency>
    <groupId>org.xwiki.commons</groupId>
    <artifactId>xwiki-commons-xml</artifactId>
    <version>13.4.4</version>
</dependency>
org.xwiki.commons:xwiki-commons-xml fixed: 13.8-rc-1
<dependency>
    <groupId>org.xwiki.commons</groupId>
    <artifactId>xwiki-commons-xml</artifactId>
    <version>13.8-rc-1</version>
</dependency>
Verify Direct and Transitive Dependencies

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

mvn dependency:tree -Dincludes=org.xwiki.commons

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2022-24898, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.xwiki.commons

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

Note: The mvn dependency:tree -Dincludes=org.xwiki.commons command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

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 Xwiki commons xml, 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

### Impact It's possible in a script to access any file accessing to the user running XWiki application server with XML External Entity Injection through the XML script service. For example: ``` {{velocity}} #set($xml=$services.get('xml')) #set($xxe_payload = "<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE root[<!ENTITY xxe SYSTEM 'file:///etc/passwd' >]><root><foo>&xxe;</foo></root>") #set($doc=$xml.parse($xxe_payload)) $xml.serialize($doc) {{/velocity}} ``` ### Patches The problem has been patched on versions 12.10.10, 13.4.4 and 13.8RC1. ### Workarounds There's no easy workaround for fixing this vulnerability other than upgrading and being careful when giving Script rights. ### References https://jira.xwiki.org/browse/XWIKI-18946 ### For more information If you have any questions or comments about this advisory: * Open an issue in [Jira XWiki](https://jira.xwiki.org) * Email us at [XWiki Security mailing-list](mailto:security@xwiki.org)

CVE-2022-24898 Affected Xwiki commons xml Versions

3 component(s)
Fixed Versions:
12.10.1013.4.413.8-rc-1
Product / Package Ecosystem Affected Versions Fixed Version
org.xwiki.commons:xwiki-commons-xml
Maven
≥ 2.7
< 12.10.10
12.10.10
org.xwiki.commons:xwiki-commons-xml
Maven
≥ 13.0.0
< 13.4.4
13.4.4
org.xwiki.commons:xwiki-commons-xml
Maven
≥ 13.5-rc-1
< 13.8-rc-1
13.8-rc-1

References

Frequently Asked Questions

What is CVE-2022-24898?
CVE-2022-24898 is a security vulnerability in Xwiki commons xml involving xwiki-commons-xml under CWE-611: Improper Restriction of XML External Entity Reference.
Which Xwiki commons xml versions are affected?
Affected versions include releases prior to 12.10.10, 13.4.4, 13.8-rc-1 across affected packages: org.xwiki.commons:xwiki-commons-xml.
What version fixes CVE-2022-24898?
Upgrading to 12.10.10, 13.4.4, 13.8-rc-1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xwiki-commons-xml affected?
Yes, org.xwiki.commons:xwiki-commons-xml is affected in releases prior to 12.10.10, 13.4.4, 13.8-rc-1. Upgrade your dependency to 12.10.10, 13.4.4, 13.8-rc-1 or later.
What is the CVSS score of CVE-2022-24898?
CVE-2022-24898 has a CVSS v3.1 base score of 4.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2022-24898?
CVE-2022-24898 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 Maven dependencies for CVE-2022-24898?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.xwiki.commons'. 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-m2r5-4w96-qxg5",
  "modified" : "2022-04-28T19:31:55Z",
  "published" : "2022-04-28T19:31:55Z",
  "aliases" : [ "CVE-2022-24898" ],
  "summary" : "Arbitrary file access through XML parsing in org.xwiki.commons:xwiki-commons-xml",
  "details" : "### Impact\n\nIt's possible in a script to access any file accessing to the user running XWiki application server with XML External Entity Injection through the XML script service.\n\nFor example:\n\n```\n{{velocity}}\n#set($xml=$services.get('xml'))\n#set($xxe_payload = \"<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE root[<!ENTITY xxe SYSTEM 'file:///etc/passwd' >]><root><foo>&xxe;</foo></root>\")\n#set($doc=$xml.parse($xxe_payload))\n$xml.serialize($doc)\n{{/velocity}}\n```\n\n### Patches\n\nThe problem has been patched on versions 12.10.10, 13.4.4 and 13.8RC1.\n\n### Workarounds\n\nThere's no easy workaround for fixing this vulnerability other than upgrading and being careful when giving Script rights.\n\n### References\n\nhttps://jira.xwiki.org/browse/XWIKI-18946\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [Jira XWiki](https://jira.xwiki.org)\n* Email us at [XWiki Security mailing-list](mailto:security@xwiki.org)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.commons:xwiki-commons-xml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.7"
      }, {
        "fixed" : "12.10.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.commons:xwiki-commons-xml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "13.0.0"
      }, {
        "fixed" : "13.4.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.commons:xwiki-commons-xml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "13.5-rc-1"
      }, {
        "fixed" : "13.8-rc-1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 13.7"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/xwiki/xwiki-commons/security/advisories/GHSA-m2r5-4w96-qxg5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24898"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xwiki/xwiki-commons/commit/947e8921ebd95462d5a7928f397dd1b64f77c7d5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/xwiki/xwiki-commons"
  }, {
    "type" : "WEB",
    "url" : "https://jira.xwiki.org/browse/XWIKI-18946"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-04-28T19:31:55Z",
    "nvd_published_at" : "2022-04-28T20:15:00Z"
  }
}