惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
小众软件
小众软件
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
Jina AI
Jina AI
博客园 - 【当耐特】
V
Visual Studio Blog
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
量子位
IT之家
IT之家
G
Google Developers Blog
V
V2EX
The GitHub Blog
The GitHub Blog
月光博客
月光博客
GbyAI
GbyAI

NodeJS Security & NodeJS Secure Coding's Blog

Hardening Your npm and pnpm Configs in the Age of Shai-Hulud Argument Injection vulnerability in git-blame@1.4.0 Argument Injection vulnerability in `gits@0.1.8` Command Injection vulnerability in `@fab1o/git@1.4.0` Command Injection vulnerability in `git-contributors` via unsanitized CLI arguments Command Injection vulnerability in `git-q@0.0.3` Command injection vulnerability via unsanitized CLI arguments in touxing/fast-git-clone Command Injection vulnerability in `willitmerge@0.2.1` A Directory Traversal Vulnerability I found in Mastra AI Frameworks MCP Server Mastering NPX: A Cheatsheet for npm and Node.js Power Users Mitigate Supply Chain Security with DevContainers and 1Password for Node.js Local Development The Tale of the Vulnerable MCP Database Server Bad Security Defaults in Mastra AI Frameworks Templates SQL Injection and Bypassing "Read-Only" Mode in Xata's MCP Server Security Advisory for qix npm supply-chain compromise affecting debug and billions of weekly download users How to Mitigate SQL Bypass in MCP Servers Enhancing MCP Server Security: A Guide to Using execFile How to Bypass Access Control in PostgreSQL in Simple PSQL MCP Server for SQL Injection Command Injection Flaws in ggit: Unveiling a Vulnerability Command Injection Vulnerability in Create MCP Server STDIO Tool Exposes System Monitoring Functions GitHub Kanban MCP Server Command Injection Vulnerability Threatens Developer Workflows Critical Command Injection Flaw in iOS Simulator MCP Server Exposes Development Environments Command Injection Vulnerability Discovered in Codehooks MCP Server: A Critical Security Analysis SSRF Shenanigans in safe-axios: Redirects Open the Backdoor SSRF Vulnerability in safe-axios: Unintended Public Address Classification Bypassing SSRF Safeguards in ssrfcheck: A Case of Incomplete Denylists Don't Be Fooled by Multicast, SSRF Bypass in private-ip Node.js Authentication from Lucia to Better Auth Bypassing SSRF Protection in nossrf: When Your Safeguards Become Loopholes Vue CLI Security Fix to Mitigate NPM Binary Planting
Argument Injection Vulnerability in ggit
2025-09-04 · via NodeJS Security & NodeJS Secure Coding's Blog

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:

  • Affected Function: The vulnerability exists in the clone function of ggit.
  • Input Validation Issue: The function doesn’t properly validate or sanitize user-provided input, particularly the url parameter.
  • Missing Flag Separation: The library doesn’t use the -- flag to separate command-line options from arguments passed to the git binary.
  • Exploitable Option: The --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.

Exploit Scenario

The provided Proof-of-Concept (POC) code demonstrates how an attacker can exploit this vulnerability:

  • The attacker provides a malicious URL that includes the --upload-pack option followed by a command to create a file named pwned in the /tmp directory.
  • Since the library doesn’t properly handle the URL, the entire string is passed to the git binary as a single argument.
  • The --upload-pack option is interpreted by the git binary, and the subsequent command to create the file is executed on the user’s machine.

Vulnerable Code and Argument Injection Exploit

  1. Install ggit@2.4.12 or earlier

  2. 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");

});

Impact

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.

Conclusion

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.