CVE-2024-52308
published high CVSS 3.1 · 8.0Connecting to a malicious Codespaces via GH CLI could allow command execution on the user's computer
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| cli | — | cli<= 2.61.0 · Other versions: unaffected | Affected | Not stated | GitHub_M |
| github | — | cli0 through 2.6.1 · Other versions: unknown | Affected | Not stated | CISA-ADP |
| SUSE / openSUSE | openSUSE-Leap-15.6 | ghaarch64 | Advisory build | 2.65.0-bp156.2.17.1 | OPENSUSE-SU-2025:0021-1 |
| Ubuntu | noble | gh | Advisory build | 2.45.0-1ubuntu0.2+esm1 | USN-7130-1 |
| SUSE / openSUSE | openSUSE-Leap-15.6 | ghi586 | Advisory build | 2.65.0-bp156.2.17.1 | OPENSUSE-SU-2025:0021-1 |
| SUSE / openSUSE | openSUSE-Leap-15.6 | ghppc64le | Advisory build | 2.65.0-bp156.2.17.1 | OPENSUSE-SU-2025:0021-1 |
| SUSE / openSUSE | openSUSE-Leap-15.6 | ghs390x | Advisory build | 2.65.0-bp156.2.17.1 | OPENSUSE-SU-2025:0021-1 |
| SUSE / openSUSE | openSUSE-Leap-15.6 | ghx86_64 | Advisory build | 2.65.0-bp156.2.17.1 | OPENSUSE-SU-2025:0021-1 |
Show 30 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| SUSE / openSUSE | openSUSE-Leap-15.6 | gh-bash-completionnoarch | Advisory build | 2.65.0-bp156.2.17.1 | OPENSUSE-SU-2025:0021-1 |
| SUSE / openSUSE | openSUSE-Leap-15.6 | gh-fish-completionnoarch | Advisory build | 2.65.0-bp156.2.17.1 | OPENSUSE-SU-2025:0021-1 |
| SUSE / openSUSE | openSUSE-Leap-15.6 | gh-zsh-completionnoarch | Advisory build | 2.65.0-bp156.2.17.1 | OPENSUSE-SU-2025:0021-1 |
| SUSE / openSUSE | openSUSE-Leap-16.0 | ghaarch64 | Advisory build | 2.96.0-bp160.1.1 | OPENSUSE-SU-2026:21310-1 |
| SUSE / openSUSE | openSUSE-Leap-16.0 | ghppc64le | Advisory build | 2.96.0-bp160.1.1 | OPENSUSE-SU-2026:21310-1 |
| SUSE / openSUSE | openSUSE-Leap-16.0 | ghs390x | Advisory build | 2.96.0-bp160.1.1 | OPENSUSE-SU-2026:21310-1 |
| SUSE / openSUSE | openSUSE-Leap-16.0 | ghx86_64 | Advisory build | 2.96.0-bp160.1.1 | OPENSUSE-SU-2026:21310-1 |
| SUSE / openSUSE | openSUSE-Leap-16.0 | gh-bash-completionnoarch | Advisory build | 2.96.0-bp160.1.1 | OPENSUSE-SU-2026:21310-1 |
| SUSE / openSUSE | openSUSE-Leap-16.0 | gh-fish-completionnoarch | Advisory build | 2.96.0-bp160.1.1 | OPENSUSE-SU-2026:21310-1 |
| SUSE / openSUSE | openSUSE-Leap-16.0 | gh-zsh-completionnoarch | Advisory build | 2.96.0-bp160.1.1 | OPENSUSE-SU-2026:21310-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | ghaarch64 | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | ghppc64le | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | ghs390x | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | ghx86_64 | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gh-bash-completionaarch64 | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gh-bash-completionppc64le | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gh-bash-completions390x | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gh-bash-completionx86_64 | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gh-fish-completionaarch64 | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gh-fish-completionppc64le | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gh-fish-completions390x | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gh-fish-completionx86_64 | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gh-zsh-completionaarch64 | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gh-zsh-completionppc64le | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gh-zsh-completions390x | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | gh-zsh-completionx86_64 | Advisory build | 2.62.0-1.1 | OPENSUSE-SU-2024:14509-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | govulncheck-vulndbaarch64 | Advisory build | 0.0.20241119T173509-1.1 | OPENSUSE-SU-2024:14513-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | govulncheck-vulndbppc64le | Advisory build | 0.0.20241119T173509-1.1 | OPENSUSE-SU-2024:14513-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | govulncheck-vulndbs390x | Advisory build | 0.0.20241119T173509-1.1 | OPENSUSE-SU-2024:14513-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | govulncheck-vulndbx86_64 | Advisory build | 0.0.20241119T173509-1.1 | OPENSUSE-SU-2024:14513-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 8.0 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H
- Scenarios
- en: GENERAL
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| cli | cli | <= 2.61.0 (affected)Default: unaffected | GitHub_M · cna |
| github | cli | 0 through 2.6.1 (affected · custom)Default: unknown | CISA-ADP · adp |
Weaknesses
1- CWE-77 CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
References
1Provider assertions
2GitHub_M · cna
Connecting to a malicious Codespaces via GH CLI could allow command execution on the user's computer
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- dce6415e1f74d33497d25227af897216543b77cc04e88ec6511eb175063b2485
- Ingested
- 23 Sep 2026, 08:30:39 UTC
- Source record
- Official CVE record