Advisory

GHSA-fqfh-778m-2v32

Also known as: GO-2022-0395

Summary

GitHub CLI can execute a git binary from the current directory

Details

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
https://github.com/golang/go/issues/38736

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2022-02-11 23:41 UTC
Modified
2024-08-21 14:57 UTC

Affected packages and fixes

github.com/cli/cli

Go · All systems

Affected

  • introduced 0, fixed 1.2.1 (semver)

Fixed versions

1.2.1

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences