MODERATE 4.9

CVE-2022-24898

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

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:

Affected Maven artifacts (1)

ArtifactAffected versionsFixed in
org.xwiki.commons » xwiki-commons-xml
>= 2.7, < 12.10.10>= 13.0.0, < 13.4.4>= 13.5-rc-1, < 13.8-rc-1
12.10.10, 13.4.4, 13.8-rc-1

Blast radius

1affected artifacts
365affected versions
1,108dependent artifacts (est.)
84,452dependent versions

54% of the dependent artifacts (608) still pull an affected version in their latest release.

DepthDependent versions
Direct
4,007
2 hops
41,284
3 hops
32,608
4 hops
6,182
5 hops
368
6 hops
3

Most used dependents

Computed from the dependency graph of build 20261127.1117 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.