cve.bz

CVE-2024-52308 github cli

9.6 criticalEPSS 0.9%Fix available

Critical (9.6) in github cli. EPSS 0.9% estimated probability of exploitation activity in the next 30 days. Fixed in github.com/cli/cli/v2 2.62.0.

On this page
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.

Severity

CVSS 3.1

9.6 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
EPSS
0.9% (unchanged from 0.9% a week ago; 0.9% 30 days ago) estimated probability of exploitation activity in the next 30 days; 61st percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2024-11-15. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-77 Improper Neutralization of Special Elements used in a Command
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-52308 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-52308?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-52308?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-52308 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
github:clibefore 2.62.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-p2h2-3vg9-4p87Gogithub.com/cli/cli/v2<2.62.02.62.0
GHSA-p2h2-3vg9-4p87Gogithub.com/cli/cli<2.62.02.62.0
GO-2024-3269Gogithub.com/cli/cliall versionsno fix published
GO-2024-3269Gogithub.com/cli/cli/v2<2.62.02.62.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12ghno fix listedDEBIAN-CVE-2024-52308
Debian13gh2.46.0-2DEBIAN-CVE-2024-52308
UbuntuPro:24.04:LTSgh2.45.0-1ubuntu0.2+esm1UBUNTU-CVE-2024-52308 USN-7130-1
SUSEPackage Hub 15 SP6gh2.65.0-bp156.2.17.1openSUSE-SU-2025:0021-1
openSUSELeap 15.6gh2.65.0-bp156.2.17.1openSUSE-SU-2025:0021-1
openSUSELeap 16.0gh2.96.0-bp160.1.1openSUSE-SU-2026:21310-1
openSUSETumbleweedgh2.62.0-1.1openSUSE-SU-2024:14509-1
openSUSETumbleweedgovulncheck-vulndb0.0.20241119T173509-1.1openSUSE-SU-2024:14513-1
Azure Linux3gh2.62.0-1AZL-53217

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE.

Attack patterns (CAPEC)

  • CAPEC-15 Command Delimiters Likelihood: High · Severity: High
  • CAPEC-40 Manipulating Writeable Terminal Devices Likelihood: High · Severity: Very High
  • CAPEC-43 Exploiting Multiple Input Interpretation Layers Likelihood: Medium · Severity: High
  • CAPEC-75 Manipulating Writeable Configuration Files Likelihood: High · Severity: Very High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-136 LDAP Injection Likelihood: High · Severity: High
  • CAPEC-183 IMAP/SMTP Command Injection Severity: Medium
  • CAPEC-248 Command Injection Likelihood: Medium · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON