{"id":"GHSA-fqfh-778m-2v32","aliases":["GHSA-fqfh-778m-2v32","GO-2022-0395"],"related":[],"kind":"vulnerability","state":"published","title":"GitHub CLI can execute a git binary from the current directory","summary":"### Impact\nGitHub 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.\n\nWindows users who run `gh` inside untrusted directories are affected.\n\n### Patches\nUsers should upgrade to GitHub CLI v1.2.1.\n\n### Workarounds\nOther than avoiding untrusted repositories, there is no workaround.\n\n### References\nhttps://github.com/golang/go/issues/38736","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"### Impact\nGitHub 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.\n\nWindows users who run `gh` inside untrusted directories are affected.\n\n### Patches\nUsers should upgrade to GitHub CLI v1.2.1.\n\n### Workarounds\nOther than avoiding untrusted repositories, there is no workaround.\n\n### References\nhttps://github.com/golang/go/issues/38736","format":"markdown","source":"ghsa"},{"lang":"en","text":"GitHub CLI can execute a git binary from the current directory in github.com/cli/cli","format":"markdown","source":"go"}],"published":"2022-02-11T23:41:11.000Z","modified":"2026-03-03T04:52:10.462Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.2.1"}],"ecosystem":"Go","package":"github.com/cli/cli","purl":"pkg:golang/github.com/cli/cli","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.2.1"}],"ecosystem":"Go","package":"github.com/cli/cli","purl":"pkg:golang/github.com/cli/cli","source":"go"}],"references":[{"url":"https://github.com/cli/cli/security/advisories/GHSA-fqfh-778m-2v32","tags":["advisory","web"],"sources":["ghsa","go"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fqfh-778m-2v32","url":"https://github.com/advisories/GHSA-fqfh-778m-2v32","licence":"CC-BY-4.0","modified":"2024-08-21T14:57:06.656Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2022-0395","url":"https://pkg.go.dev/vuln/GO-2022-0395","licence":"CC-BY-4.0","modified":"2026-03-03T04:52:10.462Z"}],"updatedAt":"2026-11-25T22:56:23.083Z"}