9.6

CVE-2024-52308: cli Command Injection

CVSS: 9.6v3.1CriticalAnalyzed
AliasesopenSUSE-SU-2025:0021-1UBUNTU-CVE-2024-52308USN-7130-1
Published 14-11-2024Last modified 15-11-2024

Vulnerability summary

CVE-2024-52308 is a critical (CVSS 9.6) Command Injection vulnerability in cli. EPSS estimates a 0.85% chance of exploitation in the next 30 days, higher than 57.9% of scored vulnerabilities.

Overall risk
70/100
0100
High · default modelHow is this calculated?
CVSS score
9.6/10
010
Critical · v3.1 (NVD)
EPSS score
0.85%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedIn no KEV catalog
RansomwareNone recordedNo known use recorded
Public exploits0No public exploits recorded

Advisory lineage

Upstream 0 · Downstream 2 · Related 4

Timeline

  1. 14-11-2024
    PublishedVulnerability first disclosed.
  2. 15-11-2024
    Last modifiedVulnerability information updated.

Description

The GitHub CLI version 2.6.1 and earlier are vulnerable to remote code execution through a malicious codespace SSH server when using `gh codespace ssh` or `gh codespace logs` commands. This has been patched in the cli v2.62.0. Developers connect to remote codespaces through an SSH server running within the devcontainer, which is generally provided through the [default devcontainer image]( https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-... https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers#using-the-default-dev-container-configuration) . GitHub CLI [retrieves SSH connection details]( https://github.com/cli/cli/blob/30066b0042d0c5928d959e288144300cb28196c9/internal/codespaces/rpc/inv... https://github.com/cli/cli/blob/30066b0042d0c5928d959e288144300cb28196c9/internal/codespaces/rpc/invoker.go#L230-L244 ), such as remote username, which is used in [executing `ssh` commands]( https://github.com/cli/cli/blob/e356c69a6f0125cfaac782c35acf77314f18908d/pkg/cmd/codespace/ssh.go#L2... https://github.com/cli/cli/blob/e356c69a6f0125cfaac782c35acf77314f18908d/pkg/cmd/codespace/ssh.go#L263 ) for `gh codespace ssh` or `gh codespace logs` commands. This exploit occurs when a malicious third-party devcontainer contains a modified SSH server that injects `ssh` arguments within the SSH connection details. `gh codespace ssh` and `gh codespace logs` commands could execute arbitrary code on the user's workstation if the remote username contains 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. In `2.62.0`, the remote username information is being validated before being used.

CVSS metrics

7 scores · 7 sources · 1 version

EPSS trend

Probability

0.85%

Chance of exploitation in the next 30 days

Percentile

58%

Versus all other CVEs

30-day change

0.00 pp

From 0.85% on 21-09-2026

21-09-202621-10-2026
EPSS score
0.85%

Known exploited

Compare KEV catalogs

Not in any of the 3 tracked catalogs.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Opensuse2 products
  • gh&distro=openSUSE Leap 15.6< 2.65.0-bp156.2.17.1
  • gh&distro=openSUSE Tumbleweed< 2.62.0-1.1
Chainguard1 product
  • gh< 2.62.0-r0
Cli1 product
Debian1 product
  • ghAll versions (No fix recorded) | < 2.46.0-2
Github1 product
Github.com/cli1 product
  • cli< 2.62.0 | All versions (No fix recorded)
Github.com/cli/cli1 product
  • v2< 2.62.0
Suse1 product
  • gh&distro=SUSE Package Hub 15 SP6< 2.65.0-bp156.2.17.1
Ubuntu1 product
  • gh< 2.45.0-1ubuntu0.2+esm1
Wolfi1 product
  • gh< 2.62.0-r0

10 vendors · 11 products

References

13 links
Show all 13 references