interactive-git-checkout has a Command Injection vulnerability
The npm package interactive-git-checkout is an interactive command-line tool that allows users to checkout a git branch while it prompts for the branch name on the command-line. It is available as an npm package and can be installed via npm install -g interactive-git-checkout.
Resources:
- Project's npm package: https://www.npmjs.com/package/interactive-git-checkout
Command Injection Vulnerability
The interactive-git-checkout tool is vulnerable to a command injection vulnerability because it passes the branch name to the git checkout command using the Node.js child process module's exec() function without proper input validation or sanitization.
The following vulnerable code snippets demonstrates the issue:
const { exec: execCb } = require('child_process');
const { promisify } = require('util');
const exec = promisify(execCb);
module.exports = async (targetBranch) => {
const { stdout, stderr } = await exec(`git checkout ${targetBranch}`);
process.stderr.write(stderr);
process.stdout.write(stdout);
};
Exploit Proof of Concept
- Install the
interactive-git-checkoutpackage (as suggested by the package's README):
npm install --global interactive-git-checkout
- Run the executable exposed by the installed package:
$ igc
- When prompted, enter the following branch name:
hello ; echo 'Command Injection Vulnerability Exploited!' > /tmp/command-injection.txt; #
Vulnerable versions
All versions of interactive-git-checkout are vulnerable to this issue, up to and including to the latest version of 1.1.4.
Author
Liran Tal
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | interactive-git-checkout | <= 1.1.4 | no fix |
References
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H- Weakness (CWE)
CWE-77- Platform
- npm
- Package
interactive-git-checkout- Disclosed
- 10.09.2025
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-4wcm-7hjf-6xw5 - CC BY 4.0
Vulnerability history: interactive-git-checkout
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
This is the only known vulnerability of this package.
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.