Arbitrary Code Execution Affecting github.com/cli/cli/pkg/cmd/repo/fork package, versions <1.2.1


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-GOLANG-GITHUBCOMCLICLIPKGCMDREPOFORK-7895543
  • published 4 Sep 2024
  • disclosed 11 Feb 2022
  • credit Dawid Golunski

Introduced: 11 Feb 2022

CVE NOT AVAILABLE CWE-94 Open this link in a new tab

How to fix?

Upgrade github.com/cli/cli/pkg/cmd/repo/fork to version 1.2.1 or higher.

Overview

Affected versions of this package are vulnerable to Arbitrary Code Execution. GitHub CLI depends on a git.exe executable being found in the system %PATH% on Windows. When 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.

Note: Windows users who run gh inside untrusted directories are affected.

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
8 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    Required
  • Scope (S)
    Changed
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    High