{"schemaVersion":3,"id":"CVE-2024-52308","aliases":["openSUSE-SU-2025:0021-1","UBUNTU-CVE-2024-52308","USN-7130-1","DEBIAN-CVE-2024-52308","CGA-h3mg-xxgw-v7w7","CGA-h8g4-mqr3-g58c","GHSA-p2h2-3vg9-4p87","GO-2024-3269","openSUSE-SU-2024:14509-1"],"status":"published","duplicateOf":null,"title":null,"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.\n\nDevelopers 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.\n\nThis 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.\n\nIn `2.62.0`, the remote username information is being validated before being used.","dates":{"published":"2024-11-14T22:55:38.693Z","modified":"2024-11-15T19:33:42.842Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":9.6,"severity":"critical","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Ubuntu","score":9.6,"severity":"critical","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","exploitability":7.2,"impact":10,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Debian","score":9.6,"severity":"critical","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","exploitability":7.2,"impact":10,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Wolfi","score":8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H","exploitability":3.3,"impact":10,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Go","score":8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H","exploitability":3.3,"impact":10,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Chainguard","score":8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H","exploitability":3.3,"impact":10,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":9.6,"severity":"critical","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00855,"percentile":0.57903,"severity":"low","asOf":"2026-10-21T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-21T00:00:00.000Z","baselineScore":0.00855},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.00855,"percentile":0.57903}],"last30":[{"date":"2026-09-21T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00855,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.00855,"percentile":0.57903}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-77","name":"Improper Neutralization of Special Elements used in a Command ('Command Injection')","description":"The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.","type":"weakness","status":"Draft","abstraction":"Class","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/77.html"}],"affected":[{"vendor":"chainguard","product":"gh","name":"gh","label":"gh","ecosystem":"Chainguard","cpePart":null,"purl":"pkg:apk/chainguard/gh","purlType":"apk","versions":[{"text":"< 2.62.0-r0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.62.0-r0","eol":null,"hubHref":null},{"vendor":"wolfi","product":"gh","name":"gh","label":"gh","ecosystem":"Wolfi","cpePart":null,"purl":"pkg:apk/wolfi/gh","purlType":"apk","versions":[{"text":"< 2.62.0-r0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.62.0-r0","eol":null,"hubHref":null},{"vendor":"cli","product":"cli","name":"cli","label":"cli","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≤ 2.61.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"≤ 2.61.0","eol":null,"hubHref":"/vendor/cli/cli"},{"vendor":"debian","product":"gh","name":"gh","label":"gh","ecosystem":"Debian","cpePart":null,"purl":"pkg:deb/debian/gh","purlType":"deb","versions":[{"text":"All versions","noFixRecorded":true,"fixedIn":null},{"text":"< 2.46.0-2","noFixRecorded":false,"fixedIn":null}],"versionsText":"All versions (No fix recorded) | < 2.46.0-2","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"gh","name":"gh","label":"gh","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/gh","purlType":"deb","versions":[{"text":"< 2.45.0-1ubuntu0.2+esm1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.45.0-1ubuntu0.2+esm1","eol":null,"hubHref":null},{"vendor":"github","product":"cli","name":"cli","label":"cli","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 2.62.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.62.0","eol":null,"hubHref":"/vendor/github/cli"},{"vendor":"github.com/cli","product":"cli","name":"github.com/cli/cli","label":"cli","ecosystem":"Go","cpePart":null,"purl":"pkg:golang/github.com/cli/cli","purlType":"golang","versions":[{"text":"< 2.62.0","noFixRecorded":false,"fixedIn":null},{"text":"All versions","noFixRecorded":true,"fixedIn":null}],"versionsText":"< 2.62.0 | All versions (No fix recorded)","eol":null,"hubHref":null},{"vendor":"github.com/cli/cli","product":"v2","name":"github.com/cli/cli/v2","label":"v2","ecosystem":"Go","cpePart":null,"purl":"pkg:golang/github.com/cli/cli/v2","purlType":"golang","versions":[{"text":"< 2.62.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.62.0","eol":null,"hubHref":null},{"vendor":"opensuse","product":"gh&distro=openSUSE Leap 15.6","name":"gh","label":"gh&distro=openSUSE Leap 15.6","ecosystem":"openSUSE","cpePart":null,"purl":"pkg:rpm/opensuse/gh&distro=openSUSE Leap 15.6","purlType":"rpm","versions":[{"text":"< 2.65.0-bp156.2.17.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.65.0-bp156.2.17.1","eol":null,"hubHref":null},{"vendor":"opensuse","product":"gh&distro=openSUSE Tumbleweed","name":"gh","label":"gh&distro=openSUSE Tumbleweed","ecosystem":"openSUSE","cpePart":null,"purl":"pkg:rpm/opensuse/gh&distro=openSUSE Tumbleweed","purlType":"rpm","versions":[{"text":"< 2.62.0-1.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.62.0-1.1","eol":null,"hubHref":null},{"vendor":"suse","product":"gh&distro=SUSE Package Hub 15 SP6","name":"gh","label":"gh&distro=SUSE Package Hub 15 SP6","ecosystem":"SUSE Linux Enterprise","cpePart":null,"purl":"pkg:rpm/suse/gh&distro=SUSE Package Hub 15 SP6","purlType":"rpm","versions":[{"text":"< 2.65.0-bp156.2.17.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.65.0-bp156.2.17.1","eol":null,"hubHref":null}],"affectedCount":11,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/cli/cli/security/advisories/GHSA-p2h2-3vg9-4p87","label":"github.com/cli/cli/security/advisories/GHSA-p2h2-3vg9-4p87","hostname":"github.com","tags":["X Refsource CONFIRM","REPORT","Advisory","WEB","Vendor Advisory"]},{"url":"https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/HUMKXZZVR2XTEF5OINR7OTNWNR5IVCYQ/","label":"lists.opensuse.org/archives/…","hostname":"lists.opensuse.org","tags":["Advisory"]},{"url":"https://bugzilla.suse.com/1233387","label":"bugzilla.suse.com/1233387","hostname":"bugzilla.suse.com","tags":["REPORT"]},{"url":"https://www.suse.com/security/cve/CVE-2024-52308","label":"www.suse.com/security/cve/CVE-2024-52308","hostname":"www.suse.com","tags":["WEB"]},{"url":"https://ubuntu.com/security/CVE-2024-52308","label":"ubuntu.com/security/CVE-2024-52308","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2024-52308","label":"www.cve.org/CVERecord?id=CVE-2024-52308","hostname":"www.cve.org","tags":["REPORT"]},{"url":"https://ubuntu.com/security/notices/USN-7130-1","label":"ubuntu.com/security/notices/USN-7130-1","hostname":"ubuntu.com","tags":["Advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2024-52308","label":"security-tracker.debian.org/tracker/CVE-2024-52308","hostname":"security-tracker.debian.org","tags":["Advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/52xxx/CVE-2024-52308.json","label":"github.com/CVEProject/cvelistV5/tree/main/cves/2024/52xxx/CVE-2024-52308.json","hostname":"github.com","tags":["Advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-52308","label":"nvd.nist.gov/vuln/detail/CVE-2024-52308","hostname":"nvd.nist.gov","tags":["Advisory","Oval"]},{"url":"https://github.com/cli/cli","label":"github.com/cli/cli","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://pkg.go.dev/vuln/GO-2024-3269","label":"pkg.go.dev/vuln/GO-2024-3269","hostname":"pkg.go.dev","tags":["WEB"]},{"url":"https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/YTCSKJMBC73WSFKWY7SLMRJFMRX4UHQF/","label":"lists.opensuse.org/archives/…","hostname":"lists.opensuse.org","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":["OPENSUSE-SU-2024:14513-1","OPENSUSE-SU-2026:21310-1"],"duplicates":[],"related":["CGA-9P6Q-RR9M-XVC9","CGA-QHX9-VC73-X5FP","OPENSUSE-SU-2024:14513-1","OPENSUSE-SU-2026:21310-1"]},"timeline":[{"kind":"published","date":"2024-11-14T22:55:38.693Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-11-15T19:33:42.842Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":70,"level":"high","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-21T18:58:35.268Z","stale":false,"partial":false}}