# CVE-2022-24898: Arbitrary file access through XML parsing in org.xwiki.commons:xwiki-commons-xml

> Attackers can read arbitrary files on the server via XML External Entity injection in the XWiki commons XML script service.

- **Severity:** Medium 4.9 (`CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 28 Apr 2022
- **Updated:** 22 Apr 2025
- **Also known as:** GHSA-m2r5-4w96-qxg5

## What is CVE-2022-24898?

CVE-2022-24898 is a medium-severity vulnerability in xwiki-commons, published on 28 Apr 2022. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

org.xwiki.commons:xwiki-commons-xml is a common module used by other XWiki top level projects. Starting in version 2.7 and prior to versions 12.10.10, 13.4.4, and 13.8-rc-1, it is possible for a script to access any file accessing to the user running XWiki application server with XML External Entity Injection through the XML script service. The problem has been patched in versions 12.10.10, 13.4.4, and 13.8-rc-1. There is no easy workaround for fixing this vulnerability other than upgrading and being careful when giving Script rights.

Weakness: CWE-611 (Improper Restriction of XML External Entity Reference)

## Which versions are affected by CVE-2022-24898?

6 open source packages ship an affected version, including org.xwiki.commons:xwiki-commons-xml. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.xwiki.commons:xwiki-commons-xml` | Maven | From 13.0.0 | 13.4.4 |
| `org.xwiki.commons:xwiki-commons-xml` | Maven | From 13.0.0 | 13.4.4 |
| `org.xwiki.commons:xwiki-commons-xml` | Maven | From 13.5-rc-1 | 13.8-rc-1 |
| `org.xwiki.commons:xwiki-commons-xml` | Maven | From 13.5-rc-1 | 13.8-rc-1 |
| `org.xwiki.commons:xwiki-commons-xml` | Maven | From 2.7 | 12.10.10 |
| `org.xwiki.commons:xwiki-commons-xml` | Maven | From 2.7 | 12.10.10 |

Products: Xwiki Commons.

## How do I fix CVE-2022-24898?

Upgrade org.xwiki.commons:xwiki-commons-xml to a fixed version for your release line: 13.4.4, 13.8-rc-1 or 12.10.10.

## Is CVE-2022-24898 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-24898 exists.

## Other vulnerabilities in xwiki-commons

- [CVE-2023-26055](https://insights.sbomify.com/CVE-2023-26055/): XWiki Commons may allow privilege escalation to programming rights via user's first name (critical 10.0)
- [CVE-2023-36471](https://insights.sbomify.com/CVE-2023-36471/): HTML sanitizer allows form elements in restricted in org.xwiki.commons:xwiki-commons-xml (critical 9.1)
- [CVE-2023-29528](https://insights.sbomify.com/CVE-2023-29528/): Cross-site Scripting in org.xwiki.commons:xwiki-commons-xml (critical 9.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-24898 and fix it if it is affected.

What it is: CVE-2022-24898 is a medium-severity vulnerability in xwiki-commons, published on 28 Apr 2022. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-24898 exists.

Affected packages and fixed versions:
- org.xwiki.commons:xwiki-commons-xml (Maven): affected from 13.0.0; fixed in 13.4.4
- org.xwiki.commons:xwiki-commons-xml (Maven): affected from 13.0.0; fixed in 13.4.4
- org.xwiki.commons:xwiki-commons-xml (Maven): affected from 13.5-rc-1; fixed in 13.8-rc-1
- org.xwiki.commons:xwiki-commons-xml (Maven): affected from 13.5-rc-1; fixed in 13.8-rc-1
- org.xwiki.commons:xwiki-commons-xml (Maven): affected from 2.7; fixed in 12.10.10
- org.xwiki.commons:xwiki-commons-xml (Maven): affected from 2.7; fixed in 12.10.10

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-24898/ (Markdown: https://insights.sbomify.com/CVE-2022-24898/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-24898
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-24898
- OSV: https://osv.dev/vulnerability/CVE-2022-24898

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-24898/
Summaries are generated and may contain mistakes; the official description above is the record.
