CVE catalog

CVE-2024-52308

GitHub CLI vulnerability

[CVE catalog]

Severity
Critical · CVSS 9.6CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Published
Source
[NVD] · [CVE record]
EPSS
0.91% · Oct 25, 2026

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.

Vulnerable and fixed packages

Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.

DistributionPackageReleaseVersionStatus
Debianghsid2.46.0-4fixed
Debianghtrixie2.46.0-3fixed
Debianghbookworm2.23.0+dfsg1-1vulnerable
UbuntughnobleNot reportedvulnerable
Ubuntughnoble2.45.0-1ubuntu0.2+esm1fixed
Opensuseghleap 16.02.96.0-bp160.1.1fixed
Ubuntughpro2.27.0+dfsg1-1build1vulnerable
Ubuntughpro2.30.0-2vulnerable
Ubuntughpro2.35.0-1vulnerable
Ubuntughpro2.40.1+dfsg1-1vulnerable
Ubuntughpro2.42.1-1vulnerable
Ubuntughpro2.43.1-1vulnerable
Ubuntughpro2.44.1-1vulnerable
Ubuntughpro2.44.1-2vulnerable
Ubuntughpro2.45.0-1vulnerable
Ubuntughpro2.45.0-1build1vulnerable
Ubuntughpro2.45.0-1ubuntu0.1vulnerable
Ubuntughpro2.45.0-1ubuntu0.2vulnerable
Ubuntughpro2.45.0-1ubuntu0.2+esm1fixed
Ubuntughpro2.27.0+dfsg1-1build1vulnerable
Ubuntughpro2.30.0-2vulnerable
Ubuntughpro2.35.0-1vulnerable
Ubuntughpro2.40.1+dfsg1-1vulnerable
Ubuntughpro2.42.1-1vulnerable
Ubuntughpro2.43.1-1vulnerable
Ubuntughpro2.44.1-1vulnerable
Ubuntughpro2.44.1-2vulnerable
Ubuntughpro2.45.0-1vulnerable
Ubuntughpro2.45.0-1build1vulnerable
Ubuntughpro2.45.0-1ubuntu0.1vulnerable
Ubuntughpro2.45.0-1ubuntu0.2vulnerable
Ubuntughpro2.45.0-1ubuntu0.2+esm1fixed
Opensuseghtumbleweed2.62.0-1.1fixed
Suseghpackage hub 15 sp62.65.0-bp156.2.17.1fixed
Opensuseghleap 15.62.65.0-bp156.2.17.1fixed

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debianghsourcesid2.46.0-2not yet assignedNot reported[1087883]
Debianghsourcetrixie2.46.0-2not yet assignedNot reported[1087883]
Debianghsourcebookworm(unfixed)not yet assignedNot reported[1087883]
Ubuntughdebnoble2.45.0-1ubuntu0.2+esm1Not reportedNot reportedNot reported
Opensuseghrpmleap 16.02.96.0-bp160.1.1Not reportedOPENSUSE-SU-2026:21310-1Not reported
Ubuntughdebpro2.45.0-1ubuntu0.2+esm1Not reportedUSN-7130-1Not reported
Ubuntughdebpro2.45.0-1ubuntu0.2+esm1Not reportedUBUNTU-CVE-2024-52308Not reported
Opensuseghrpmtumbleweed2.62.0-1.1Not reportedOPENSUSE-SU-2024:14509-1Not reported
Suseghrpmpackage hub 15 sp62.65.0-bp156.2.17.1Not reportedOPENSUSE-SU-2025:0021-1Not reported
Opensuseghrpmleap 15.62.65.0-bp156.2.17.1Not reportedOPENSUSE-SU-2025:0021-1Not reported

[Debian bug #1087883]

OpenFactory catalog packages

[Debian 12 (Bookworm)]

  • [gh]Affected
    Details (2)
    • 2.23.0+dfsg1-1 · amd64 · bookworm

      Affected

      usn · gh · debian · bookworm; usn · gh · debian · 12

    • 2.23.0+dfsg1-1 · arm64 · bookworm

      Affected

      usn · gh · debian · bookworm; usn · gh · debian · 12

[openSUSE Tumbleweed]

  • Source package: [gh]

    Details (1)
    • 2.98.0-1.1 · noarch · tumbleweed

      Unknown · Fixed: 2.62.0-1.1

      Version impact unknown

      usn · gh · opensuse · tumbleweed

  • Source package: [gh]

    Details (1)
    • 2.98.0-1.1 · noarch · tumbleweed

      Unknown · Fixed: 2.62.0-1.1

      Version impact unknown

      usn · gh · opensuse · tumbleweed

  • Source package: [gh]

    Details (1)
    • 2.98.0-1.1 · noarch · tumbleweed

      Unknown · Fixed: 2.62.0-1.1

      Version impact unknown

      usn · gh · opensuse · tumbleweed

  • [gh]Fixed

    Source package: [gh]

    Details (1)
    • 2.98.0-1.1 · x86_64 · tumbleweed

      Fixed · Fixed: 2.62.0-1.1

      usn · gh · opensuse · tumbleweed

[Debian 13 (Trixie)]

  • [gh]Fixed
    Details (2)
    • 2.46.0-3 · amd64 · trixie

      Fixed · Fixed: 2.46.0-2

      usn · gh · debian · 13

    • 2.46.0-3 · arm64 · trixie

      Fixed · Fixed: 2.46.0-2

      usn · gh · debian · 13

Observed:

References