Arbitrary Command Injection Affecting github.com/cli/cli/internal/codespaces/rpc package, versions <2.62.0


Severity

Recommended
0.0
medium
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-GITHUBCOMCLICLIINTERNALCODESPACESRPC-8381312
  • published 15 Nov 2024
  • disclosed 14 Nov 2024
  • credit RyotaK

How to fix?

Upgrade github.com/cli/cli/internal/codespaces/rpc to version 2.62.0 or higher.

Overview

Affected versions of this package are vulnerable to Arbitrary Command Injection via the gh codespace ssh or gh codespace logs commands. An attacker can execute arbitrary code on the user's workstation by manipulating SSH connection details to send a remote username containing something like -oProxyCommand="echo hacked" #. The -oProxyCommand flag causes ssh to execute the provided command while # shell comment causes any other ssh arguments to be ignored.

Note:

This is only exploitable if the user connects to a malicious third-party devcontainer.

References

CVSS Scores

version 4.0
version 3.1
Expand this section

Snyk

Recommended
6.3 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Attack Requirements (AT)
    None
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    Active
  • Confidentiality (VC)
    None
  • Integrity (VI)
    None
  • Availability (VA)
    None
  • Confidentiality (SC)
    High
  • Integrity (SI)
    High
  • Availability (SA)
    High