CVE-2023-31126 Improper Neutralization of Invalid Characters in Data Attribute Names in org.xwiki.commons:xwiki-commons-xml

Critical 9.1 Published Updated

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.

Weakness: CWE-79, CWE-86

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.

PackageAffectedFixed in
org.xwiki.commons:xwiki-commons-xml MavenFrom 14.6-rc-114.10.4
org.xwiki.commons:xwiki-commons-xml MavenFrom 14.6-rc-114.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.

All Xwiki Xwiki vulnerabilities

Sources

Also known as GHSA-pv7v-ph6g-3gxv.

Is CVE-2023-31126 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free