CVE & CISA-KEV Catalog

CVE-2024-52308

HIGH
8.0
CVSS v3
NVD

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.

How to fix

Remediation Available
ghDebian
Fixed in:2.46.0-2CVE-2024-52308
Fixed in:2.46.0-2CVE-2024-52308
ghUbuntu
Fixed in:2.45.0-1ubuntu0.2+esm1USN-7130-1
GitHub CLIWindows application
Affected:2.62.0Fixed in:2.62.0GitHub, Inc.

Remediation is compiled from vendor and distribution security advisories. Always confirm against the linked source for your exact version and platform.

CVSS v3 Vector

Exploitability

Attack VectorNetwork
Attack ComplexityHigh
Privileges RequiredLow
User InteractionRequired
ScopeChanged

Impact

ConfidentialityHigh
IntegrityHigh
AvailabilityHigh

CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H

Exploit Intelligence

0.86%probability of exploitation in 30 days
54thpercentile

Moderate risk: more likely to be exploited than 54% of all known CVEs.

References

Vendor Advisory1

Related Vulnerabilities

Other CWE-77 (Command Injection) vulnerabilities, ordered by exploit likelihood. View all

CVESeverityCVSSEPSSExploitedFix
CVE-2024-3400Critical10.0100%KEV + Ransom-
CVE-2024-21887Critical9.1100%KEV + Ransom-
CVE-2023-1671Critical9.8100%KEVFix
CVE-2023-1389High8.8100%KEVFix
CVE-2021-1498Critical9.8100%KEVFix
CVE-2012-1823Critical9.8100%KEVFix
Embed a live status badge for CVE-2024-52308
CVE-2024-52308 severity badge

Markdown

[![CVE-2024-52308](https://tridentstack.com/cve/badge/CVE-2024-52308.svg)](https://tridentstack.com/cve/CVE-2024-52308)

HTML

<a href="https://tridentstack.com/cve/CVE-2024-52308"><img src="https://tridentstack.com/cve/badge/CVE-2024-52308.svg" alt="CVE-2024-52308"></a>

Find and fix vulnerabilities across your fleet

TridentStack Control continuously scans your Windows, macOS, and Linux fleet for known vulnerabilities, prioritizes them by severity and active exploitation, and patches them automatically.

Start free

This product uses NVD data but is not endorsed or certified by the NVD. EPSS scores courtesy of FIRST.org (https://www.first.org/epss). Source: CISA KEV Catalog. Data as of 2024-11-20.