Apache RocketMQ NameServer 5.0.0 ~ 5.1.1
Apache RocketMQ NameServer 4.0.0 ~ 4.9.6
docker pull apache/rocketmq:4.9.6
docker pull apacherocketmq/rocketmq-console:2.0.0
docker run -d -p 9876:9876 -v /data/namesrv/logs:/root/logs\
-v /data/namesrv/store:/root/store --name rmqnamesrv\
-e "MAX_POSSIBLE_HEAP=100000000" apache/rocketmq:4.9.6 sh mqnamesrv
mkdir -p /mydata/rocketmq/conf/
vi /mydata/rocketmq/conf/broker.conf
粘贴以下内容
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = SYNC_FLUSH
brokerIP1 = X.X.X.X #主机IP
docker run -d -p 10911:10911 -p 10909:10909 -v /data/broker/logs:/root/logs\
-v /data/broker/store:/root/store\
-v /mydata/rocketmq/conf/broker.conf:/opt/rocketmq/conf/broker.conf\
--name rmqbroker --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876"\
-e "MAX_POSSIBLE_HEAP=200000000" apache/rocketmq:4.9.6 sh mqbroker\
-c /opt/rocketmq/conf/broker.conf
docker run -d --name rmqconsole -p 8899:8080 --link rmqnamesrv:namesrv\
-e "JAVA_OPTS=-Drocketmq.namesrv.addr=10.88.80.135:9876\
-Dcom.rocketmq.sendMessageWithVIPChannel=false"\
-t apacherocketmq/rocketmq-console:2.0.0
python3脚本执行
我感觉就是一个任意文件写入,毕竟利用需要受害者去执行,所以CVE漏洞报告原文中也用的是"possible when using update"这种含糊不清的字眼。
漏洞补丁为:
与CVE-2023-33246的修复相比,增加了configStorePath黑名单关键字。
从CVE-2023-33246中的update()起手:
persist()中使用string2File造成文件写入,第二个参数是filename:
getStorePath()中,返回值realStorePath由实例化的Field的path填充,而这个filed可以根据发送的body字段可控:
升级到安全版本
Apache RocketMQ NameServer 5.1.2
Apache RocketMQ NameServer 4.9.7