


























The reported security disclosure details an Argument Injection vulnerability in the ggit npm package version 2.4.12 and earlier. Let’s break down the issue and how to address it.
Let’s breakdown the Argument Injection vulnerability in ggit:
clone function of ggit.url parameter.-- flag to separate command-line options from arguments passed to the git binary.--upload-pack option in the Git command allows specifying a custom command to execute on the remote server. However, in this case, it’s being used to inject arbitrary commands on the user’s machine.The provided Proof-of-Concept (POC) code demonstrates how an attacker can exploit this vulnerability:
--upload-pack option followed by a command to create a file named pwned in the /tmp directory.git binary as a single argument.--upload-pack option is interpreted by the git binary, and the subsequent command to create the file is executed on the user’s machine.Install ggit@2.4.12 or earlier
Establish the following POC:
const clone = require("ggit").cloneRepo;
clone({
url: "--upload-pack=$(touch /tmp/pwned)",
folder: "/tmp/dbd",
}).then(function () {
console.log("cloned repo to destination folder");
});
This vulnerability can allow attackers to execute arbitrary commands on a user’s system with the privileges of the user running the ggit library. This could lead to data theft, system compromise, or other malicious activities.
Argument Injection vulnerabilities can be serious security risks. It’s crucial to keep software libraries updated and to validate user input whenever possible to prevent such attacks. By following these recommendations, you can help mitigate the risk associated with this vulnerability in ggit.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。