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


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.04% (11th percentile)

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 Learn

Learn about Arbitrary Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GITHUBCOMCLICLIV2INTERNALCODESPACESRPC-8381313
  • published15 Nov 2024
  • disclosed14 Nov 2024
  • creditRyotaK

Introduced: 14 Nov 2024

NewCVE-2024-52308  (opens in a new tab)
CWE-77  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade github.com/cli/cli/v2/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