XWiki Platform XSS/CSRF Remote Code Execution in XWiki.ConfigurableClass
Description
XWiki Platform is a generic wiki platform. Starting in 2.3 and prior to versions 14.10.15, 15.5.2, and 15.7-rc-1, there is a reflected XSS or also direct remote code execution vulnerability in the code for displaying configurable admin sections. The code that can be passed through a URL parameter is only executed when the user who is visiting the crafted URL has edit right on at least one configuration section. While any user of the wiki could easily create such a section, this vulnerability doesn't require the attacker to have an account or any access on the wiki. It is sufficient to trick any admin user of the XWiki installation to visit the crafted URL. This vulnerability allows full remote code execution with programming rights and thus impacts the confidentiality, integrity and availability of the whole XWiki installation. This has been fixed in XWiki 14.10.15, 15.5.2 and 15.7RC1. The patch can be manually applied to the document XWiki.ConfigurableClass.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.xwiki.platform:xwiki-platform-administration-uiMaven | >= 2.3, < 14.10.15 | 14.10.15 |
org.xwiki.platform:xwiki-platform-administration-uiMaven | >= 15.0-rc-1, < 15.5.2 | 15.5.2 |
org.xwiki.platform:xwiki-platform-administration-uiMaven | >= 15.6-rc-1, < 15.7-rc-1 | 15.7-rc-1 |
Affected products
1- Range: >= 2.3, < 14.10.15
Patches
15e14c8d08fd0XWIKI-21167: Improve escaping of space parameter in ConfigurableClass
2 files changed · +40 −1
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-ui/src/main/resources/XWiki/ConfigurableClass.xml+1 −1 modified@@ -407,7 +407,7 @@ $xwiki.jsfx.use('js/xwiki/actionbuttons/actionButtons.js', true) #if($globaladmin) #set($queryString = "editor=globaladmin&amp;section=") #else - #set($queryString = "space=${currentSpace}&amp;section=") + #set($queryString = "space=$escapetool.url($currentSpace)&amp;section=") #if($request.getParameter('editor')) #set($queryString = "editor=$escapetool.url($request.getParameter('editor'))&amp;$queryString") #end
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-ui/src/test/java/org/xwiki/administration/ConfigurableClassPageTest.java+39 −0 modified@@ -19,10 +19,13 @@ */ package org.xwiki.administration; +import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; import java.util.Objects; +import org.apache.http.client.utils.URLEncodedUtils; import org.jsoup.nodes.Document; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -54,6 +57,7 @@ import com.xpn.xwiki.objects.BaseObject; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; @@ -208,4 +212,39 @@ void escapeNonViewableSections() throws Exception assertEquals(String.format("xe.admin.configurable.noViewAccessSomeApplications [[%s]]", MY_SECTION_SERIALIZED), errorMessage); } + + @Test + void escapeSectionLink() throws Exception + { + // Create a new section document. + XWikiDocument mySectionDoc = new XWikiDocument(MY_SECTION); + BaseObject object = mySectionDoc.newXObject(CONFIGURABLE_CLASS, this.context); + object.setStringValue("displayInCategory", "other"); + object.setStringValue("displayInSection", "other"); + object.set("scope", "WIKI+ALL_SPACES", this.context); + this.xwiki.saveDocument(mySectionDoc, this.context); + + // Make sure the section document is returned by the query and the user has access to edit. + when(this.query.execute()).thenReturn(List.of(MY_SECTION_SERIALIZED)).thenReturn(List.of()); + when(this.oldcore.getMockRightService() + .hasAccessLevel(eq("edit"), any(), any(), any())).thenReturn(true); + + // Set a new document with space ">{{/html}}{{noscript /}} as context document to check escaping of the + // current space. + String spaceName = "\">{{/html}}{{noscript /}}"; + DocumentReference docRef = new DocumentReference(WIKI_NAME, spaceName, "WebHome"); + XWikiDocument contextDoc = new XWikiDocument(docRef); + this.xwiki.saveDocument(contextDoc, this.context); + this.context.setDoc(contextDoc); + + XWikiDocument doc = loadPage(CONFIGURABLE_CLASS); + Document htmlPage = renderHTMLPage(doc); + String link = Objects.requireNonNull(htmlPage.selectFirst("li.other a")).attr("href"); + URI uri = new URI(link); + // Parse the query parameters and check the space name. + URLEncodedUtils.parse(uri, StandardCharsets.UTF_8).stream() + .filter(pair -> pair.getName().equals("space")) + .findFirst() + .ifPresentOrElse(pair -> assertEquals(spaceName, pair.getValue()), () -> fail("No space parameter in URL")); + } }
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-cp3j-273x-3jxcghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-50722ghsaADVISORY
- github.com/xwiki/xwiki-platform/commit/5e14c8d08fd0c5b619833d35090b470aa4cb52b0ghsax_refsource_MISCWEB
- github.com/xwiki/xwiki-platform/security/advisories/GHSA-cp3j-273x-3jxcghsax_refsource_CONFIRMWEB
- jira.xwiki.org/browse/XWIKI-21167ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.