Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade org.xwiki.platform:xwiki-platform-search-solr-ui
to version 15.10.11, 16.4.1 or higher.
Affected versions of this package are vulnerable to Eval Injection via the SolrSearch
process. An attacker can execute arbitrary code on the server by sending a crafted request to the vulnerable endpoint.
This vulnerability can be mitigated by editing Main.SolrSearchMacros
in SolrSearchMacros.xml
here to match the rawResponse
macro in macros.vm#L2824 with a content type of application/xml
, instead of simply outputting the content of the feed.
Without being logged in, go to
<host>/xwiki/bin/get/Main/SolrSearch?media=rss&text=%7D%7D%7D%7B%7Basync%20async%3Dfalse%7D%7D%7B%7Bgroovy%7D%7Dprintln%28"Hello%20from"%20%2B%20"%20search%20text%3A"%20%2B%20%2823%20%2B%2019%29%29%7B%7B%2Fgroovy%7D%7D%7B%7B%2Fasync%7D%7D%20
If there is an output, and the title of the RSS feed contains Hello from search text:42
, then the instance is vulnerable.