PT-2024-8770

CVE-2024-52308

·

Published

2024-11-14

·

Updated

2026-08-25

Description by

CVSS 3.1
9.6
Critical
MetricsAV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions: GitHub CLI versions 2.6.1 and earlier
Description: The issue is related to remote code execution through a malicious codespace SSH server when using gh codespace ssh or gh codespace logs commands. This occurs when a malicious third-party devcontainer contains a modified SSH server that injects ssh arguments within the SSH connection details, allowing arbitrary code execution 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 version 2.62.0, the remote username information is being validated before being used.
Recommendations: Upgrade to version 2.62.0 to fix the issue. As a temporary workaround, consider validating the remote username information before using it in ssh commands. Exercise caution when using custom devcontainer images, prefer default or pre-built devcontainers from trusted sources.
Exploitability
Exploit
Fix
Impacts
Researchers
Vendors
Affected products
Related identifiers
GHSA-P2H2-3VG9-4P87
AZL-53217
GO-2024-3269
OPENSUSE-SU-2024:14509-1
OPENSUSE-SU-2024:14513-1
OPENSUSE-SU-2025:0021-1
OPENSUSE-SU-2026:21310-1
USN-7130-1
Found an issue in the description? Have something to add? Feel free to write us 👾