go-getter < 1.7.5 git命令注入漏洞

北京赛克艾威科技有限公司 2024-06-26


  • 漏洞编号:CVE-2024-6257
  • 漏洞等级:高危
  • 漏洞标签:发布预警、公开漏洞
  • 发布时间:2024-06-26

漏洞描述

go\-getter 是一个 Golang 库,用于从 URL、文件系统及其他位置获取资源,支持通过git协议拉取仓库。 受影响版本中,由于 get\_git.go 文件未对 \`.git\` 目录中的文件进行校验,如果攻击者对克隆的 git 存储库可控,攻击者可诱导用户覆盖原有存储库中的 git config 文件,当用户更新该仓库时会触发远程代码执行。

修复建议

1. 将组件 github.com/hashicorp/go-getter 升级至 1.7.5 及以上版本

参考链接

https://www.oscs1024.com/hd/MPS-bzci-201d

https://nvd.nist.gov/vuln/detail/CVE-2024-6257

https://discuss.hashicorp.com/t/hcsec-2024-13-hashicorp-go-getter-vulnerable-to-code-execution-on-git-update-via-git-config-manipulation/68081

https://github.com/hashicorp/go-getter/commit/9906874a23919a81eff097d84fdb8f98525ac880

https://www.oscs1024.com/hd/MPS-bzci-201d