CVE-2024-52308
Last modified
CVE-2024-52308 is a critical-severity vulnerability rated 9.6/10 on the CVSS scale. 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-... EPSS estimates a 0.86% chance of exploitation in the next 30 days.
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.
Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Weakness Enumeration
Affected Software
| Vendor | Product | Versions |
|---|---|---|
| Github | Cli | < 2.62.0 |
References
Timeline
- Published
- Last Modified
- Status
- Analyzed
Frequently Asked Questions
What is CVE-2024-52308?
How severe is CVE-2024-52308?
How do I fix CVE-2024-52308?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2024
- CVE-2024-52302common-user-management is a robust Spring Boot application f…8.7
- CVE-2024-52303aiohttp is an asynchronous HTTP client/server framework for …8.7
- CVE-2024-52304aiohttp is an asynchronous HTTP client/server framework for …7.5
- CVE-2024-52305UnoPim is an open-source Product Information Management (PIM…4.8
- CVE-2024-52306FileManager provides a Backpack admin interface for files an…9.8
- CVE-2024-52307authentik is an open-source identity provider. Due to the us…5.6
- CVE-2024-52309SFTPGo is a full-featured and highly configurable SFTP, HTTP…5.1
- CVE-2024-5231A vulnerability was found in Campcodes Complete Web-Based Sc…6.5
- CVE-2024-52311Authentication tokens issued via Cognito in data.all are not…6.3
- CVE-2024-52312Due to inconsistent authorization permissions, data.all may …5.4
- CVE-2024-52313An authenticated data.all user is able to manipulate a getDa…5.3
- CVE-2024-52314A data.all admin team member who has access to the customer-…6.9
Are you affected by CVE-2024-52308?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
