← 返回列表

Argument Injection vulnerability in `gits@0.1.8`

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

\~ 1 min read

Argument Injection vulnerability in `gits@0.1.8`

An Argument Injection vulnerability was discovered in the `gits` npm package that could allow attackers to execute arbitrary commands on the host

The gits npm package describes itself as a Local promise-returning git command wrappers for Node.js. Attempts to contact the maintainer through the GitHub repository through an open issue were not responded to, and the vulnerability remains unpatched.

Resources:

Background on exploitation

I’m reporting an Argument Injection vulnerability in gits npm package.

This vulnerability manifests with the library’s clone(dir, repo, branch, cwd) API,
which allows user input to specify the branch, repo, and other metadata. When some
of that input to the function is controlled by the user, it may cause a command
injection.

Exploit

  1. Install gits@0.1.8 or earlier
  2. Create the empty directory /tmp/balloon to hold the repository to clone to
  3. Establish the following POC:
var gits = require("gits");
gits.clone(  "/tmp/balloon",  "file:///tmp/none",  "master",  "--upload-pack=touch /tmp/abcd");
  1. Observe new file created on disk at /tmp/abcd
原文链接:https://www.nodejs-security.com/blog/argument-injection-vulnerability-in-gits-0-1-8/