medium
GitHub CLI can execute a git binary from the current directory
- Severity
- medium rating by GitHub
- Published
- Last changed
- Also known as
- GO-2022-0395
Description
Impact
GitHub CLI depends on a git.exe executable being found in system %PATH% on Windows. However, if a malicious .\git.exe or .\git.bat is found in the current working directory at the time of running gh, the malicious command will be invoked instead of the system one.
Windows users who run gh inside untrusted directories are affected.
Patches
Users should upgrade to GitHub CLI v1.2.1.
Workarounds
Other than avoiding untrusted repositories, there is no workaround.
References
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| github.com/cli/cli (Go) | before 1.2.1 | GitHub Advisory Database, Go Vulnerability Database |
What each source says
GitHub Advisory Database
Impact
GitHub CLI depends on a git.exe executable being found in system %PATH% on Windows. However, if a malicious .\git.exe or .\git.bat is found in the current working directory at the time of running gh, the malicious command will be invoked instead of the system one.
Windows users who run gh inside untrusted directories are affected.
Patches
Users should upgrade to GitHub CLI v1.2.1.
Workarounds
Other than avoiding untrusted repositories, there is no workaround.
References
Go Vulnerability Database
GitHub CLI can execute a git binary from the current directory in github.com/cli/cli
References
Sources
| Source | Record | Licence |
|---|---|---|
| GitHub Advisory Database | GHSA-fqfh-778m-2v32 changed 2024-08-21 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2022-0395 changed 2026-03-03 | CC-BY-4.0 |