spring又曝出核弹级漏洞,利用十分简单,在java9以上的spring上通杀,预计影响不亚于去年的log4j漏洞。目前还无CVE编号
#1. 漏洞通报
1.绿盟科技
SPRING CLOUD FUNCTION SPEL表达式注入漏洞通告
2. freebuf
漏洞情报 | Spring Cloud Function SPEL表达式注入漏洞通报
3. 启明星辰
【漏洞通告】Spring Cloud Function SpEL表达式注入漏洞
2. 漏洞原因
Spring Cloud Function将请求头中的“spring.cloud.function.routing-expression”参数作为 SpEL表达式进行处理,造成SpEL表达式注入漏洞
目前poc已在github上泄露:
https://github.com/hktalent/spring-spel-0day-poc
spel
3. 验证环境搭建
源代码编译
wget https://github.com/spring-cloud/spring-cloud-function/archive/refs/tags/v3.1.6.zip
unzip v3.1.6.zip
cd spring-cloud-function-3.1.6
cd spring-cloud-function-samples/function-sample-pojo
mvn package
java -jar ./target/function-sample-pojo-2.0.0.RELEASE.jar
由于网络原因,在执行mvn
操作时花费时间会比较长,已经编译好的已上传到csdn上
function-sample-pojo-2.0.0.RELEASE.jar
服务端运行截图:
4.poc
参见spring-spel-0day-poc
spel内容。原poc运行在mac上,迁移到linux上效果如下,可以看到能达到执行任意命令的效果,效果有点儿恐怖。运行结果