原创 威胁对抗能力部 [绿盟科技安全情报](javascript:void(0) 今天
通告编号:NS-2020-0028
2020-04-16
TA****G: | Git、凭证泄露、CVE-2020-5260 |
---|---|
漏****洞危害: | 攻击者利用此漏洞,可****获取Git用户凭据。 |
版本: | 1.0 |
1
漏洞概述
4月15日,Git发布安全通告公布了一个导致Git用户凭证泄露的漏洞(CVE-2020-5260)。Git使用凭证助手(credential helper)来帮助用户存储和检索凭证。当URL中包含经过编码的换行符(%0a)时,可能将非预期的值注入到credential helper的协议流中。受影响版本 Git对恶意 URL 执行 git clone 命令时会触发此漏洞,攻击者可利用恶意URL欺骗Git客户端发送主机凭据。请相关用户采取措施进行防护。
参考链接:
https://github.com/git/git/security/advisories/GHSA-qm7j-c969-7j4q
SEE MORE →
2影响范围
受影响版本
不受影响版本
3漏洞检测
3.1 版本检测
相关用户可通过版本检测的方式判断当前应用是否存在风险。
使用如下命令可查看当前Git的版本:
git --version
若当前使用版本在受影响范围内,则可能存在安全风险。
4漏洞防护
4.1 官方升级
目前官方已在最新版本中修复了该漏洞,请受影响的用户尽快升级版本进行防护,官方下载链接:https://github.com/git/git/releases
可使用如下命令进行安装更新(以2.23.2为例):
wget https://github.com/git/git/archive/v2.23.2.tar.gztar zxvf v2.23.2.tar.gzcd git-2.23.2make configure./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconvmake all docmake install install-doc install-htmlecho “export PATH=$PATH:/usr/local/git/bin:/usr/local/git/libexec/git-core” >> /etc/bashrc
4.2 其他防护措施
若相关用户暂时无法进行升级操作,也可采用以下措施进行防护:
方法一:使用以下命令禁用****credential helper
git config --unset credential.helpergit config --global --unset credential.helpergit config --system --unset credential.helper
方法二:提高警惕避免恶意****URL
1、git clone时检查URL的主机名和用户名部分是否存在编码的换行符(%0a)或凭据协议注入的证据(例如host=github.com)。
2、避免将子模块与不受信任的仓库一起使用(不要使用clone --recurse-submodules;只有在检查.gitmodules中找到url之后,才使用git submodule update)。
3、请勿对不信任的URL执行git clone。
转载自https://mp.weixin.qq.com/s/juunkJX_MfD85M2KrWlT3A