GitHub CLI - Execution of Arbitrary Git Binary

github.com/cli/cli Updated 02 Oct 2025

Summary

11/02/2022
MODERATE
Yes i
Moderate
Not published

GHSA-fqfh-778m-2v32: GitHub CLI can execute a git binary from the current directory. Affects github.com/cli/cli versions < 1.2.1. Fixed in 1.2.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

GitHub CLI is a command-line tool that provides an interface to GitHub repositories and services. It is written in Go and allows users to perform various Git operations and interact with GitHub from the command line. This vulnerability affects GitHub CLI versions prior to v1.2.1 on Windows systems.

Vulnerability Detail

The vulnerability in GitHub CLI arises from its dependency on a git.exe executable found in the system %PATH% on Windows. When running gh command, if a malicious .\git.exe or .\git.bat file is present in the current working directory, it will be executed instead of the legitimate system command. This can lead to the execution of arbitrary commands, potentially allowing an attacker to compromise the system or perform unauthorized actions. Windows users who run gh inside untrusted directories are affected by this vulnerability.

How To Fix

Latest published version: v1.14.0 as of 22 Oct 2026

go get github.com/cli/cli@v1.14.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.2.1

This is the first release that contains the fix.

go get github.com/cli/cli@v1.2.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround for this vulnerability other than avoiding running gh command inside untrusted directories. Users should exercise caution and ensure that the current working directory does not contain any malicious .\git.exe or .\git.bat files.

Conclusion

The vulnerability in GitHub CLI allows for the execution of arbitrary commands if a malicious git.exe or git.bat file is present in the current working directory. Users should upgrade to GitHub CLI v1.2.1 or later to fix this vulnerability. It is also important to exercise caution and avoid running gh command inside untrusted directories. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/cli/cli →

Share this vulnerability

FAQ

GitHub CLI versions prior to v1.2.1 on Windows systems are affected.

The vulnerability allows for the execution of arbitrary commands, potentially leading to system compromise or unauthorized actions.

No, this vulnerability specifically affects Windows systems.

The only workaround is to avoid running gh command inside untrusted directories.

You can check the version of GitHub CLI by running the gh version command in your terminal.

References

Related vulnerabilities

Recent vulnerabilities recorded for github.com/cli/cli.

How To Fix

Latest published version: v1.14.0 as of 22 Oct 2026

go get github.com/cli/cli@v1.14.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.2.1

This is the first release that contains the fix.

go get github.com/cli/cli@v1.2.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback