Skip to content

Commit 67500a9

Browse files
committed
spring
1 parent 7bda538 commit 67500a9

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
## 分类
2222

23-
当前问题总数:90
23+
当前问题总数:93
2424

2525
[Java本身的安全问题 - 22个](https://github.com/4ra1n/JavaSecInterview/tree/master/java)
2626

@@ -30,9 +30,9 @@
3030

3131
[Log4j2组件相关的安全问题 - 10个](https://github.com/4ra1n/JavaSecInterview/tree/master/log4j2)
3232

33-
[Spring框架相关的安全问题 - 19个](https://github.com/4ra1n/JavaSecInterview/tree/master/spring)
33+
[Spring框架相关的安全问题 - 21个](https://github.com/4ra1n/JavaSecInterview/tree/master/spring)
3434

35-
[内存马专题 - 11个](https://github.com/4ra1n/JavaSecInterview/tree/master/memshell)
35+
[内存马专题 - 12个](https://github.com/4ra1n/JavaSecInterview/tree/master/memshell)
3636

3737
[反序列化CC链专题 - 8个](https://github.com/4ra1n/JavaSecInterview/tree/master/cc)
3838

spring/README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ username[#this.getClass().forName("java.lang.Runtime").getRuntime().exec("calc.e
153153

154154

155155

156-
### 最新的Spring Cloud Gateway SPEL的RCE漏洞可以回显吗(★★★★)
156+
### Spring Cloud Gateway SPEL的RCE漏洞可以回显吗(★★★★)
157157

158158
P牛在漏洞爆出的凌晨就发布了相关的环境和POC
159159

@@ -171,8 +171,34 @@ P牛在漏洞爆出的凌晨就发布了相关的环境和POC
171171

172172

173173

174-
### 最新的Spring Cloud Gateway SPEL的RCE漏洞如何修复的(★★)
174+
### Spring Cloud Gateway SPEL的RCE漏洞如何修复的(★★)
175175

176176
参考很多`SPEL`漏洞的修复手段,默认情况使用`StandardContext`可以执行`Runtime.getRuntime().exec()`这样的危险方法
177177

178-
修复是重写一个`GatewayContext`用来执行`SPEL`,这个`context`的效果是只能执行有限的操作
178+
修复是重写一个`GatewayContext`用来执行`SPEL`,这个`context`的底层是`SimpleEvaluationContext`只能执行有限的操作
179+
180+
181+
182+
### Spring Cloud Function RCE漏洞了解吗(★★)
183+
184+
这也是`Spring Cloud`种的一个组件,不过并不常用
185+
186+
利用方式是某个请求头支持`SpEL`的格式并且会执行
187+
188+
```http
189+
POST / HTTP/1.1
190+
...
191+
spring.cloud.function.routing-expression: SPEL
192+
```
193+
194+
修复方案比较简单,使用`SimpleEvaluationContext`即可
195+
196+
197+
198+
### Spring Framework 拒绝服务漏洞了解吗(★★)
199+
200+
参考先知社区`4ra1n`师傅的文章:https://xz.aliyun.com/t/11114
201+
202+
危害不大,但影响较广,所有能够执行`SpEL`的框架,都可以通过初始化巨大的数组造成拒绝服务漏洞
203+
204+
修复方案是限制`SpEL`种数组初始化的长度(一般业务也不可能在`SpEL`种初始化很大的数组)

0 commit comments

Comments
 (0)