CVE-2025-59046: interactive-git-checkout has Command Injection vulnerability

Published Sep 9, 2025
·
Updated

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:

js const { exec: execCb } = require('childprocess'); 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):

bash npm install --global interactive-git-checkout

2. Run the executable exposed by the installed package:

bash $ igc

3. When prompted, enter the following branch name:

bash 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

Other sources

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. Versions up to and including 1.1.4 of the interactive-git-checkout tool are vulnerable to a command injection vulnerability because the software 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. Commit 8dd832dd302af287a61611f4f85e157cd1c6bb41 fixes the issue.

MITRE

Affected Software

2 affected components
npm interactive-git-checkout<=1.1.4
npm/interactive-git-checkout<=1.1.4

Event History

Sep 9, 2025
CVE Published
via MITRE·10:33 PM
Data Sourced
via MITRE·10:33 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 PM
DescriptionSeverityWeakness
Sep 10, 2025
Advisory Published
via GitHub·09:37 PM
Data Sourced
via GitHub·09:37 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-59046?

CVE-2025-59046 has been assigned a moderate severity rating due to the potential for environmental manipulation.

2

How do I fix CVE-2025-59046?

To resolve CVE-2025-59046, upgrade the 'interactive-git-checkout' package to version 1.1.5 or later.

3

What versions of 'interactive-git-checkout' are affected by CVE-2025-59046?

Versions up to and including 1.1.4 of 'interactive-git-checkout' are affected by CVE-2025-59046.

4

Who is responsible for addressing CVE-2025-59046?

The maintainers of the 'interactive-git-checkout' npm package are responsible for addressing CVE-2025-59046.

5

Is CVE-2025-59046 a known exploit?

As of now, there are no known exploits reported for CVE-2025-59046.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203