GitHub CLI - Execution of Arbitrary Git Binary from Current Directory
Summary
GO-2022-0395: GitHub CLI can execute a git binary from the current directory in github.com/cli/cli. 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 functionalities. It is written in Go and is designed to enhance the GitHub workflow for developers. The vulnerability affects the 'github.com/cli/cli' package.
Vulnerability Detail
The vulnerability in GitHub CLI allows the execution of a git binary from the current directory. This can lead to arbitrary code execution and potential unauthorized access to sensitive information. An attacker with control over the current directory can manipulate the git binary executed by GitHub CLI, potentially compromising the integrity and security of the system.
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 known workaround for this vulnerability. It is crucial to update the package to the fixed version as soon as possible.
Conclusion
The vulnerability in GitHub CLI allows the execution of arbitrary git binaries from the current directory, posing a significant security risk. It is crucial to update the 'github.com/cli/cli' package to version 1.2.1 or later to mitigate this vulnerability.
See every vulnerability recorded for github.com/cli/cli →
FAQ
GitHub CLI is a command-line tool that provides an interface to GitHub repositories and functionalities. It simplifies the workflow for developers working with GitHub.
The vulnerability allows the execution of arbitrary git binaries, which can lead to unauthorized access, code execution, and potential compromise of the system.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. It analyzes your Gopkg.lock file and provides real-time alerts for open-source vulnerabilities.
No, there is no known workaround for this vulnerability. It is essential to update the 'github.com/cli/cli' package to the fixed version.
You can find more information about this vulnerability in the VulnDB entry at https://pkg.go.dev/vuln/GO-2022-0395.
References
Related vulnerabilities
Recent vulnerabilities recorded for github.com/cli/cli.