CVE-2023-36471 HTML sanitizer allows form elements in restricted in org.xwiki.commons:xwiki-commons-xml

Critical 9.1 Published Updated

An HTML sanitizer flaw in XWiki commons allows attackers to inject form elements, potentially leading to remote code execution or phishing when an admin submits the crafted form.

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-36471?

CVE-2023-36471 is a critical cross-site scripting vulnerability in xwiki-commons, published on 29 Jun 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

Xwiki commons is the common modules used by other XWiki top level projects. The HTML sanitizer that is included in XWiki since version 14.6RC1 allowed form and input HTML tags. In the context of XWiki, this allows an attacker without script right to either create forms that can be used for phishing attacks or also in the context of a sheet, the attacker could add an input like `{{html}}<input type="hidden" name="content" value="{{groovy}}println(&quot;Hello from Groovy!&quot;)" />{{/html}}` that would allow remote code execution when it is submitted by an admin (the sheet is rendered as part of the edit form). The attacker would need to ensure that the edit form looks plausible, though, which can be non-trivial as without script right the attacker cannot display the regular content of the document. This has been patched in XWiki 14.10.6 and 15.2RC1 by removing the central form-related tags from the list of allowed tags. Users are advised to upgrade. As a workaround an admin can manually disallow the tags by adding `form, input, select, textarea, button` to the configuration option `xml.htmlElementSanitizer.forbidTags` in the `xwiki.properties` configuration file.

Weakness: CWE-79, CWE-74

Which versions are affected by CVE-2023-36471?

4 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.6
org.xwiki.commons:xwiki-commons-xml MavenFrom 14.6-rc-114.10.6
org.xwiki.commons:xwiki-commons-xml MavenFrom 15.0-rc-115.2-rc-1
org.xwiki.commons:xwiki-commons-xml MavenFrom 15.0-rc-115.2-rc-1

Products include Xwiki Commons.

How do I fix CVE-2023-36471?

Upgrade org.xwiki.commons:xwiki-commons-xml to a fixed version for your release line: 14.10.6 or 15.2-rc-1.

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-36471 being exploited?

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

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as GHSA-6pqf-c99p-758v.

Is CVE-2023-36471 in your software?

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

Check your SBOMs for free