Critical severityNVD Advisory· Published Jul 24, 2025· Updated Jul 25, 2025
XWiki Platform vulnerable to SQL injection through getdeleteddocuments.vm template sort parameter
CVE-2025-32429
Description
XWiki Platform is a generic wiki platform offering runtime services for applications built on top of it. In versions 9.4-rc-1 through 16.10.5 and 17.0.0-rc-1 through 17.2.2, it's possible for anyone to inject SQL using the parameter sort of the getdeleteddocuments.vm. It's injected as is as an ORDER BY value. This is fixed in versions 16.10.6 and 17.3.0-rc-1.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.xwiki.platform:xwiki-platform-distribution-warMaven | >= 9.4-rc-1, < 16.10.6 | 16.10.6 |
org.xwiki.platform:xwiki-platform-distribution-warMaven | >= 17.0.0-rc-1, < 17.3.0-rc-1 | 17.3.0-rc-1 |
Affected products
1- Range: >= 9.4-rc-1, < 16.10.6
Patches
2f502b5d5fd36XWIKI-23093: Improve deleted documents query
2 files changed · +2 −2
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/org/xwiki/query/hql/internal/DefaultHQLStatementValidator.java+1 −1 modified@@ -117,7 +117,7 @@ public void checkOrderBySafe(List<String> allowedPrefixes, String orderByValue) } if (!valid) { - throw new QueryException("Usafe ORDER BY value [" + orderByValue + "].", null); + throw new QueryException("Unsafe ORDER BY value [" + orderByValue + "].", null); } } }
xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/getdeleteddocuments.vm+1 −1 modified@@ -49,7 +49,6 @@ $response.setContentType("application/json") #set ($order = "$!request.sort") #set ($orderQueryPart = '') #if ($order != '') - #set($discard = $services.query.hql.checkOrderBySafe(['ddoc.'], $order)) #set ($orderDirection = "$!{request.get('dir').toLowerCase()}") #if ("$!orderDirection" != '' && "$!orderDirection" != 'asc') #set($orderDirection = 'desc') @@ -59,6 +58,7 @@ $response.setContentType("application/json") ## So we filter on the document full name instead, which is the expected behavior. #set ($order = 'ddoc.fullName') #end + #set($discard = $services.query.hql.checkOrderBySafe(['ddoc.'], $order)) ## Weird things happen if we use "ORDER BY" (upper case), at least on HSQLDB. Other DBs may behave differently #set ($orderQueryPart = "order by ${order} ${orderDirection}") #end
dfd0744e9c18XWIKI-23093: Improve deleted documents query
2 files changed · +2 −2
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/org/xwiki/query/hql/internal/DefaultHQLStatementValidator.java+1 −1 modified@@ -117,7 +117,7 @@ public void checkOrderBySafe(List<String> allowedPrefixes, String orderByValue) } if (!valid) { - throw new QueryException("Usafe ORDER BY value [" + orderByValue + "].", null); + throw new QueryException("Unsafe ORDER BY value [" + orderByValue + "].", null); } } }
xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/getdeleteddocuments.vm+1 −1 modified@@ -49,7 +49,6 @@ $response.setContentType("application/json") #set ($order = "$!request.sort") #set ($orderQueryPart = '') #if ($order != '') - #set($discard = $services.query.hql.checkOrderBySafe(['ddoc.'], $order)) #set ($orderDirection = "$!{request.get('dir').toLowerCase()}") #if ("$!orderDirection" != '' && "$!orderDirection" != 'asc') #set($orderDirection = 'desc') @@ -59,6 +58,7 @@ $response.setContentType("application/json") ## So we filter on the document full name instead, which is the expected behavior. #set ($order = 'ddoc.fullName') #end + #set($discard = $services.query.hql.checkOrderBySafe(['ddoc.'], $order)) ## Weird things happen if we use "ORDER BY" (upper case), at least on HSQLDB. Other DBs may behave differently #set ($orderQueryPart = "order by ${order} ${orderDirection}") #end
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
6- github.com/advisories/GHSA-vr59-gm53-v7cqghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-32429ghsaADVISORY
- github.com/xwiki/xwiki-platform/commit/dfd0744e9c18d24ac66a0d261dc6cafd1c209101ghsax_refsource_MISCWEB
- github.com/xwiki/xwiki-platform/commit/f502b5d5fd36284a50890ad26d168b7d8dc80bd3ghsax_refsource_MISCWEB
- github.com/xwiki/xwiki-platform/security/advisories/GHSA-vr59-gm53-v7cqghsax_refsource_CONFIRMWEB
- jira.xwiki.org/browse/XWIKI-23093ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.