Skip to content

Arbitrary file access through XML parsing in org.xwiki.commons:xwiki-commons-xml

Moderate severity GitHub Reviewed Published Apr 28, 2022 in xwiki/xwiki-commons • Updated Jan 30, 2023

Package

maven org.xwiki.commons:xwiki-commons-xml (Maven)

Affected versions

>= 2.7, < 12.10.10
>= 13.0.0, < 13.4.4
>= 13.5-rc-1, <= 13.7

Patched versions

12.10.10
13.4.4
13.8-rc-1

Description

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:

References

@tmortagne tmortagne published to xwiki/xwiki-commons Apr 28, 2022
Published to the GitHub Advisory Database Apr 28, 2022
Reviewed Apr 28, 2022
Published by the National Vulnerability Database Apr 28, 2022
Last updated Jan 30, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N

EPSS score

0.132%
(50th percentile)

Weaknesses

CVE ID

CVE-2022-24898

GHSA ID

GHSA-m2r5-4w96-qxg5

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.