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:
- Open an issue in Jira XWiki
- Email us at XWiki Security mailing-list
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed 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
54% of the dependent artifacts (608) still pull an affected version in their latest release.
| Depth | Dependent 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
- org.xwiki.platform » xwiki-platform-oldcore449 usages
- org.xwiki.platform » xwiki-platform-rendering-macro-velocity175 usages
- org.xwiki.platform » xwiki-platform-bridge150 usages
- org.xwiki.rendering » xwiki-rendering-macro-html145 usages
- org.xwiki.rendering » xwiki-rendering-api106 usages
- org.xwiki.platform » xwiki-platform-test-docker101 usages
- org.xwiki.rendering » xwiki-rendering-test94 usages
- org.xwiki.platform » xwiki-platform-rest-server85 usages
- org.xwiki.platform » xwiki-platform-tool-packager-plugin77 usages
- org.xwiki.rendering » xwiki-rendering-syntax-xwiki2177 usages
- org.xwiki.platform » xwiki-platform-administration-ui75 usages
- org.xwiki.platform » xwiki-platform-rendering-macro-include74 usages
- org.xwiki.platform » xwiki-platform-test-page72 usages
- org.xwiki.platform » xwiki-platform-test-oldcore71 usages
- org.xwiki.platform » xwiki-platform-query-manager71 usages
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.
References
| Advisory | NVD CVE-2022-24898 | nvd.nist.gov |
| Package | xwiki/xwiki-commons | github.com |
| Web | xwiki/xwiki-commons advisory GHSA-m2r5-4w96-qxg5 | github.com |
| Web | xwiki/xwiki-commons commit 947e892 | github.com |
| Web | browse/XWIKI-18946 | jira.xwiki.org |
