CVE-2024-52308: Command Execution Vulnerability in github.com/cli/cli via Malicious Codespaces

github.com/cli/cli Updated 02 Oct 2025

Summary

19/11/2024
No i
Unrated
Not published

CVE-2024-52308: Connecting to a malicious Codespaces via GH CLI could allow command execution on the user's computer in github.com/cli/cli. Affected versions are not published. No fix is published. How to fix ↓

Also tracked for

The same CVE-2024-52308 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The github.com/cli/cli package is a command-line interface for GitHub, enabling users to interact with GitHub repositories and perform various tasks directly from the terminal. It is widely used for its convenience and integration with GitHub's features. However, this package is vulnerable to a security issue that arises when connecting to potentially malicious Codespaces, which could lead to unauthorized command execution on the user's machine.

Vulnerability Detail

The vulnerability stems from the ability of the GH CLI to connect to Codespaces, which are cloud-based development environments provided by GitHub. If a user connects to a malicious Codespace, it could execute arbitrary commands on the user's local machine, leading to severe security risks such as data theft, system compromise, or unauthorized access to sensitive information. This issue is particularly concerning as it exploits the trust users place in the GitHub CLI and the Codespaces feature.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary measure, users should avoid connecting to unknown or untrusted Codespaces. Always verify the source of the Codespace before establishing a connection to minimize the risk of executing malicious commands.

Conclusion

CVE-2024-52308 is a significant vulnerability in the github.com/cli/cli package that can lead to command execution on a user's machine when connecting to malicious Codespaces. Users are advised to update to version 2.62.0 or later to mitigate this risk and to exercise caution when connecting to Codespaces.

See every vulnerability recorded for github.com/cli/cli →

Share this vulnerability

FAQ

CVE-2024-52308 is a vulnerability in the github.com/cli/cli package that allows command execution on a user's computer when connecting to a malicious Codespace.

You can check if your application is affected by using Vulert, which monitors and alerts for open-source vulnerabilities. Visit Vulert Scanner to analyze your Gopkg.lock file without any signup.

If you cannot update the package right away, avoid connecting to untrusted Codespaces as a temporary workaround to protect your system.

Codespaces are cloud-based development environments provided by GitHub that allow developers to work on their projects from anywhere. However, they can pose security risks if not used cautiously.

More information about CVE-2024-52308 can be found at the official Go vulnerability database: https://pkg.go.dev/vuln/GO-2024-3269.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/cli/cli.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback