Apache Solr RCE 未授权上传漏洞 CVE-2020-13957

漏洞描述

在特定的Solr版本中ConfigSet API存在未授权上传漏洞,攻击者利用漏洞可实现远程代码执行。

影响版本

Apache Solr 6.6.0 -6.6.5

Apache Solr 7.0.0 -7.7.3

Apache Solr 8.0.0 -8.6.2

环境搭建

选择一个存在漏洞的版本

下载各版本Solr地址

这里复现使用的是 Apache Solr 7.7.0 进行复现

下载后执行以下命令进行环境部署

cd solr-7.7.0
./bin/solr start -e cloud -force

然后一路回车,直至出现

Created collection 'gettingstarted' with 2 shard(s), 2 replica(s) with config-set 'gettingstarted'

Enabling auto soft-commits with maxTime 3 secs using the Config API

POSTing request to Config API: http://localhost:8983/solr/gettingstarted/config
{"set-property":{"updateHandler.autoSoftCommit.maxTime":"3000"}}
Successfully set-property updateHandler.autoSoftCommit.maxTime to 3000


SolrCloud example running, please visit: http://localhost:8983/solr

访问 http://xxx.xxx.xxx.xxx:8983/solr/ 正常即可

漏洞复现

在攻击机上下载目标版本的Solr,执行下列命令打包压缩文件

将 vuln.zip 进行上传

name参数为压缩包的文件名

利用漏洞创建一个 core

name参数为创建的core核心名

collection.configName参数为上传的文件名

查看core列表,发现已经成功创建

再使用 Apache Solr Velocity模板远程执行 CVE-2019-17558 即可执行任意命令

POC使用详情参考另一篇复现文章

漏洞利用POC

使用前按复现步骤上传对应版本的zip文件,例如我这里上传的文件为 qwert.zip,其他使用方法与 Apache Solr Velocity模板远程执行 CVE-2019-17558 的POC使用方法类似

Last updated

Was this helpful?