CVE-2023-31126 Improper Neutralization of Invalid Characters in Data Attribute Names in org.xwiki.commons:xwiki-commons-xml
Attackers can inject arbitrary HTML and execute scripts via invalid data attributes in the XWiki XML library, requiring an upgrade to patched versions.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2023-31126?
CVE-2023-31126 is a critical cross-site scripting vulnerability in Xwiki Xwiki, published on 9 May 2023. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
`org.xwiki.commons:xwiki-commons-xml` is an XML library used by the open-source wiki platform XWiki. The HTML sanitizer, introduced in version 14.6-rc-1, allows the injection of arbitrary HTML code and thus cross-site scripting via invalid data attributes. This vulnerability does not affect restricted cleaning in HTMLCleaner as there attributes are cleaned and thus characters like `/` and `>` are removed in all attribute names. This problem has been patched in XWiki 14.10.4 and 15.0 RC1 by making sure that data attributes only contain allowed characters. There are no known workarounds apart from upgrading to a version including the fix.
Which versions are affected by CVE-2023-31126?
2 open source packages ship an affected version, including org.xwiki.commons:xwiki-commons-xml. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.xwiki.commons:xwiki-commons-xml Maven | From 14.6-rc-1 | 14.10.4 |
org.xwiki.commons:xwiki-commons-xml Maven | From 14.6-rc-1 | 14.10.4 |
Products include Xwiki Xwiki.
How do I fix CVE-2023-31126?
Upgrade org.xwiki.commons:xwiki-commons-xml to 14.10.4 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2023-31126 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-31126 exists.
Public exploit code: 2 proofs of concept on GitHub.
Other vulnerabilities in Xwiki Xwiki
- CVE-2025-24893 XWiki Platform Eval Injection
- CVE-2025-53836 XWiki Rendering is vulnerable to RCE attacks when processing nested macros
- CVE-2024-55662 XWiki allows remote code execution through the extension sheet
- CVE-2024-55877 XWiki allows remote code execution from account through macro descriptions and XWiki.XWikiSyntaxMacrosList
- CVE-2024-37901 XWiki Platform vulnerable to remote code execution from account via SearchSuggestConfigSheet
Sources
Also known as GHSA-pv7v-ph6g-3gxv.