BreachSpiderVerified, not vibes

CVE-2024-52308 in Github Cli

Critical 9.6

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 devconta...

Affects 1 product from 1 vendor. Facts below cite their sources.

CVSS 3.19.6
EPSS1.4%
EPSS percentile72th
FixSee advisory

Remotely exploitable over the network, low complexity, no authentication required, requires user interaction, can impact systems beyond the vulnerable component, full confidentiality impact, full integrity impact, full availability impact.

Affected products and versions

VendorProductAffected versions
Github Cli < 2.62.0

A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.

Fix and vendor advisory

View Vendor Advisory →

Vendor PSIRT: [email protected]

Exploitation

CISA known-exploitedNot in the CISA KEV catalog
Public exploitNot confirmed

Official 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.

Source: NIST NVD / MITRE CVE.

Record details

CVE IDCVE-2024-52308
BreachSpider IDBS-2024-GLOBAL-210628-C
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Published2024-11-14
Last modified2026-06-17
Weakness (CWE)
SourceNVD

Weakness definitions

CWE-77: Command Injection

Attacker injects operating system commands through application inputs passed to a shell or system call.

Related attack patterns (CAPEC)

CAPEC-43 Exploiting Multiple Input Interpretation Layers via CWE-77

CAPEC-76 Manipulating Web Input to File System Calls via CWE-77

CAPEC-15 Command Delimiters via CWE-77

CAPEC-40 Manipulating Writeable Terminal Devices via CWE-77

CAPEC-75 Manipulating Writeable Configuration Files via CWE-77

Show all 8

CAPEC-136 LDAP Injection via CWE-77

CAPEC-183 IMAP/SMTP Command Injection via CWE-77

CAPEC-248 Command Injection via CWE-77

Mapping is CWE to CAPEC per MITRE CAPEC 3.9.

Analysis AI-written, not human-reviewed

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.

An attacker could exploit this vulnerability by setting up a malicious SSH server that a developer connects to via the GitHub CLI. This could lead to arbitrary code execution on the developer's machine.

Questions

What is CVE-2024-52308?

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.

What is the CVSS score for CVE-2024-52308?

CVE-2024-52308 has CVSS 9.6 (Critical). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H. EPSS: 1.4%.

Is CVE-2024-52308 actively exploited?

No confirmed active exploitation of CVE-2024-52308 as of 2026-09-25.

How do I remediate CVE-2024-52308?

Priority: IMMEDIATE. Advisory: https://github.com/cli/cli/security/advisories/GHSA-p2h2-3vg9-4p87 PSIRT: [email protected]

What systems are affected by CVE-2024-52308?

CVE-2024-52308 affects Github Cli.

For developers and AI agents

Run this check from your own code or agent

REST API

curl -s https://breachspider.com/api/v1/assets/correlate-cves \
 -H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"assets":[{"asset_id":"dev-1","vendor":"Github","product":"Cli","version":"1.0"}]}'

API reference

Python SDK

pip install breachspider

PyPI · GitHub

MCP for AI agents

# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp

Setup for Claude, ChatGPT, Cursor

Free trial: 14 days, 750 device checks, no card.

Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.