GHSA-fqfh-778m-2v32: Github.com/cli/cli GitHub CLI Can Execute A Vulnerability

MODERATE
Published
Advisory Summary

GHSA-fqfh-778m-2v32 is a MODERATE github cli can execute a vulnerability (General Security Weakness) affecting Github.com/cli/cli libraries in the Go ecosystem. The issue involves github cli can execute a git binary from the current directory. Remediation is available by upgrading affected packages to version 1.2.1.

GHSA-fqfh-778m-2v32 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-fqfh-778m-2v32
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Github.com/cli/cli
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-fqfh-778m-2v32

To remediate this vulnerability, upgrade all affected Github.com/cli/cli dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/cli/cli fixed: 1.2.1
Upgrade github.com/cli/cli to 1.2.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/cli/cli

How to Check if You Are Affected

To determine whether your application is affected by GHSA-fqfh-778m-2v32, inspect your project dependencies for Github.com/cli/cli:

inspect dependencies for github.com/cli/cli

Analyze the terminal output to locate any version of Github.com/cli/cli in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Github.com/cli/cli, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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

GHSA-fqfh-778m-2v32 Affected Github.com/cli/cli Versions

1 component(s)
Fixed Versions:
1.2.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cli/cli
Go
< 1.2.1
1.2.1

References

Frequently Asked Questions

What is GHSA-fqfh-778m-2v32?
GHSA-fqfh-778m-2v32 is a security vulnerability in Github.com/cli/cli involving GitHub CLI can execute a git binary from the current directory under General Security Weakness.
Which Github.com/cli/cli versions are affected?
Affected versions include releases prior to 1.2.1 across affected packages: github.com/cli/cli.
What version fixes GHSA-fqfh-778m-2v32?
Upgrading to 1.2.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/cli/cli affected?
Yes, github.com/cli/cli is affected in releases prior to 1.2.1. Upgrade your dependency to 1.2.1 or later.
What CWE is associated with GHSA-fqfh-778m-2v32?
GHSA-fqfh-778m-2v32 is classified under General Security Weakness.
How can I check Go dependencies for GHSA-fqfh-778m-2v32?
Run the dependency tree command: 'inspect dependencies for github.com/cli/cli'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fqfh-778m-2v32",
  "modified" : "2021-05-21T22:06:12Z",
  "published" : "2022-02-11T23:41:11Z",
  "aliases" : [ ],
  "summary" : "GitHub CLI can execute a git binary from the current directory",
  "details" : "### 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",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cli/cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cli/cli/security/advisories/GHSA-fqfh-778m-2v32"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-21T22:06:12Z",
    "nvd_published_at" : null
  }
}