主机安全服务(新版)HSS-Git用户凭证泄露漏洞(CVE-2020-5260):其他防护建议

时间:2024-06-28 17:42:51

其他防护建议

若您暂时无法进行升级操作,也可以采用以下方式进行防护:

  • 方式一:使用以下命令禁用credential helper

    git config --unset credential.helper

    git config --global --unset credential.helper

    git 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。
support.huaweicloud.com/bestpractice-hss2.0/hss_06_0026.html