Git中的远程代码执行漏洞已被修复 多个工具受影响

jopen 5年前
   <p style="text-align: center;"><a href="/misc/goto?guid=4984298435054553193" title="Git"><img alt="Git中的远程代码执行漏洞已被修复 多个工具受影响" src="https://simg.open-open.com/show/ebbb53c38d9f150c72fc91e8b8b1bf7c.png" /></a></p>    <p>据外媒 BleepingComputer <a href="/misc/goto?guid=4984298435139047834">报道</a>,Git 项目组于前两天公布了一个在 Git 命令行客户端、Git Desktop 和 Atom 中发现的任意代码执行漏洞,这是一个比较严重的安全漏洞,可能会使得恶意仓库在易受攻击的计算机上远程执行命令。</p>    <p>这个漏洞已被分配 CVE-2018-17456 这个唯一 ID,与之前的 CVE-2017-1000117 可选注入漏洞相似 —— 恶意仓库可以新建一个 .gitmodules 文件,其中包含以破折号开头的 URL。</p>    <p style="text-align:center"><img alt="Git中的远程代码执行漏洞已被修复 多个工具受影响" src="https://simg.open-open.com/show/942c3ab8f1122eccecf2e26cccd52596.png" /></p>    <p>通过破折号,当 Git 使用 --recurse-submodules 参数来克隆仓库时,该命令会将 URL 翻译为一个选项,然后可以使用该选项在计算机上进行远程代码执行。</p>    <p>当运行 "git clone --recurse-submodules" 时,Git 会解析 .gitmodules 文件中的 URL 字段,然后将其作为参数传递给 "git clone" 子进程。如果 URL 字段是一个字符串,并使用短划线开头,这个 "git clone" 子进程将会把 URL 翻译为一个选项。这可能导致用户运行 "git clone" 时,会执行 superproject 中的任意脚本。</p>    <p>下面<a href="/misc/goto?guid=4984298435340355163">通过一个例子</a>进行说明,下面的漏洞使用了恶意的 .gitmodules 文件(注意 URL 如何以破折号开头),以使得 Git 认为这是一个选项。然后 "touch VULNERABLE/git@github.com:/timwr/test.git" 这条命令将会被执行。</p>    <blockquote>     <p>[submodule "test"] path = test url = ssh://-oProxyCommand=touch VULNERABLE/git@github.com:/timwr/test.git</p>    </blockquote>    <p>此漏洞已在 Git v2.19.1 (with backports in v2.14.5, v2.15.3, v2.16.5, v2.17.2, and v2.18.1), GitHub Desktop 1.4.2, Github Desktop 1.4.3-beta0, Atom 1.31.2 和 Atom 1.32.0-beta3 中得到修复。</p>    <p>Git 项目组强烈建议所有用户升级到最新版本的 <a href="/misc/goto?guid=4984298435407587283">Git client</a>, <a href="/misc/goto?guid=4984298435499457408">Github Desktop</a> 或 <a href="/misc/goto?guid=4958827634624582917">Atom</a>,以免遭受恶意仓库的攻击。</p>    <p>来自: <a href="/misc/goto?guid=4984298435592750613" id="link_source2">cnBeta</a></p>