GitHub CLI - Execution of Arbitrary Git Binary
Summary
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 ↓
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.
No signup required · Results in about 60 seconds
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 →
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.