{"id":"CVE-2024-39930","aliases":["EUVD-2024-3615","GHSA-p69r-v3h4-rj4f","GHSA-vm62-9jw3-c8w3","GO-2024-2969"],"status":"published","title":"Duplicate Advisory: github.com/gogs/gogs affected by CVE-2024-39930","description":"The built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code execution. Authenticated attackers can exploit this by opening an SSH connection and sending a malicious --split-string env request if the built-in SSH server is activated. Windows installations are unaffected.","severity":{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.07743,"percentile":0.94677,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":true,"fix_available":true},"cwes":["CWE-88"],"published":"2024-07-04T00:00:00Z","modified":"2026-10-28T02:30:36Z","exploits":[{"source":"exploitdb","id":"EDB-52348","title":"gogs 0.13.0 - Remote Code Execution (RCE)","type":"remote","platform":"multiple","date":"2025-07-02","url":"https://www.exploit-db.com/exploits/52348"},{"source":"pocgithub","id":"alexander47777/-CVE-2024-39930","title":"alexander47777/-CVE-2024-39930","date":"2025-07-22","url":"https://github.com/alexander47777/-CVE-2024-39930"},{"source":"pocgithub","id":"laachy/CVE-2024-39930-ptrace-detection-mitigation","title":"laachy/CVE-2024-39930-ptrace-detection-mitigation","date":"2025-10-13","url":"https://github.com/laachy/CVE-2024-39930-ptrace-detection-mitigation"},{"source":"pocgithub","id":"theMcSam/CVE-2024-39930-PoC","title":"theMcSam/CVE-2024-39930-PoC","date":"2025-06-29","url":"https://github.com/theMcSam/CVE-2024-39930-PoC"}],"fixes":[{"ecosystem":"Go","package":"gogs.io/gogs","fixed_in":["0.13.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"gogs.io/gogs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.13.0"},{"fixed":"0.13.1"}]}]},{"source":"osv","ecosystem":"Go","package":"gogs.io/gogs","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.13.1"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/gogs/gogs","ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}]}],"products":[{"vendor":"gogs","product":"gogs"}],"references":[{"url":"https://github.com/gogs/gogs/releases","tags":["x_transferred","Release Notes","package","web"]},{"url":"https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1/","tags":["x_transferred","Third Party Advisory","article"]},{"url":"https://www.vicarius.io/vsociety/posts/argument-injection-in-gogs-ssh-server-cve-2024-39930","tags":["Exploit","Third Party Advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-39930","tags":["advisory"]},{"url":"https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1","tags":["web"]},{"url":"https://github.com/advisories/GHSA-p69r-v3h4-rj4f","tags":["advisory"]},{"url":"https://github.com/gogs/gogs/security/advisories/GHSA-vm62-9jw3-c8w3","tags":["web"]},{"url":"https://github.com/advisories/GHSA-vm62-9jw3-c8w3"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/39xxx/CVE-2024-39930.json","tags":["advisory"]},{"url":"https://github.com/gogs/gogs","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-39930","description":"The built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code execution. Authenticated attackers can exploit this by opening an SSH connection and sending a malicious --split-string env request if the built-in SSH server is activated. Windows installations are unaffected.","status":"published","published":"2024-07-04T00:00:00Z","modified":"2024-08-28T15:22:31.592Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N","level":"critical","assessor":"cna"}],"cwes":["CWE-88"],"updated_at":"2026-11-02T14:34:19.28149Z"}],"euvd":[{"id":"EUVD-2024-3615","description":"The built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code execution. Authenticated attackers can exploit this by opening an SSH connection and sending a malicious --split-string env request if the built-in SSH server is activated. Windows installations are unaffected.","status":"published","published":"2024-07-04T00:00:00Z","modified":"2024-08-28T15:22:31Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N","level":"critical"}],"updated_at":"2026-11-03T00:56:09.376102Z"}],"ghsa":[{"id":"GHSA-p69r-v3h4-rj4f","title":"Duplicate Advisory: github.com/gogs/gogs affected by CVE-2024-39930","description":"# Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-vm62-9jw3-c8w3. This link is maintained to preserve external references.\n\n# Original Description\nThe built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code execution. Authenticated attackers can exploit this by opening an SSH connection and sending a malicious --split-string env request if the built-in SSH server is activated. Windows installations are unaffected.","status":"withdrawn","published":"2024-07-04T18:31:10Z","modified":"2024-12-23T20:37:29Z","cvss":[{"version":"4.0","score":9.4,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H","level":"critical"},{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-88"],"updated_at":"2026-11-02T14:38:26.167657Z"},{"id":"GHSA-vm62-9jw3-c8w3","title":"Gogs has an argument Injection in the built-in SSH server","description":"### Impact\n\nWhen the built-in SSH server is enabled (`[server] START_SSH_SERVER = true`), unprivileged user accounts with at least one SSH key can execute arbitrary commands on the Gogs instance with the privileges of the user specified by `RUN_USER` in the configuration. It allows attackers to access and alter any users' code hosted on the same instance.\n\n### Patches\n\nThe `env` command sent to the internal SSH server has been changed to be a passthrough (https://github.com/gogs/gogs/pull/7868), i.e. the feature is effectively removed. Users should upgrade to 0.13.1 or the latest 0.14.0+dev.\n\n### Workarounds\n\n[Disable the use of built-in SSH server](https://github.com/gogs/gogs/blob/7adac94f1e93cc5c3545ea31688662dcef9cd737/conf/app.ini#L76-L77) on operating systems other than Windows.\n\n### References\n\nhttps://www.cve.org/CVERecord?id=CVE-2024-39930\n","status":"published","published":"2024-12-23T20:38:34Z","modified":"2024-12-23T20:38:35Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N","level":"critical"}],"cwes":["CWE-88"],"updated_at":"2026-11-02T14:38:26.167657Z"}],"nvd":[{"id":"CVE-2024-39930","description":"The built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code execution. Authenticated attackers can exploit this by opening an SSH connection and sending a malicious --split-string env request if the built-in SSH server is activated. Windows installations are unaffected.","status":"published","published":"2024-07-04T16:15:02.277Z","modified":"2026-06-17T07:43:03.143Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"secondary"},{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"primary"}],"cwes":["CWE-88"],"updated_at":"2026-11-02T14:10:10.545705Z"}],"osv":[{"id":"CVE-2024-39930","description":"The built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code execution. Authenticated attackers can exploit this by opening an SSH connection and sending a malicious --split-string env request if the built-in SSH server is activated. Windows installations are unaffected.","status":"published","published":"2024-07-04T00:00:00Z","modified":"2026-10-28T02:30:36.743136422Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N","level":"critical"}],"updated_at":"2026-11-02T15:44:41.618074Z"},{"id":"GHSA-p69r-v3h4-rj4f","title":"Duplicate Advisory: github.com/gogs/gogs affected by CVE-2024-39930","description":"# Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-vm62-9jw3-c8w3. This link is maintained to preserve external references.\n\n# Original Description\nThe built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code execution. Authenticated attackers can exploit this by opening an SSH connection and sending a malicious --split-string env request if the built-in SSH server is activated. Windows installations are unaffected.","status":"withdrawn","published":"2024-07-04T18:31:10Z","modified":"2024-12-23T20:56:55.885554Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical"},{"version":"4.0","score":9.4,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H","level":"critical"}],"cwes":["CWE-88"],"updated_at":"2026-11-02T15:46:52.891208Z"},{"id":"GHSA-vm62-9jw3-c8w3","title":"Gogs has an argument Injection in the built-in SSH server","description":"### Impact\n\nWhen the built-in SSH server is enabled (`[server] START_SSH_SERVER = true`), unprivileged user accounts with at least one SSH key can execute arbitrary commands on the Gogs instance with the privileges of the user specified by `RUN_USER` in the configuration. It allows attackers to access and alter any users' code hosted on the same instance.\n\n### Patches\n\nThe `env` command sent to the internal SSH server has been changed to be a passthrough (https://github.com/gogs/gogs/pull/7868), i.e. the feature is effectively removed. Users should upgrade to 0.13.1 or the latest 0.14.0+dev.\n\n### Workarounds\n\n[Disable the use of built-in SSH server](https://github.com/gogs/gogs/blob/7adac94f1e93cc5c3545ea31688662dcef9cd737/conf/app.ini#L76-L77) on operating systems other than Windows.\n\n### References\n\nhttps://www.cve.org/CVERecord?id=CVE-2024-39930\n","status":"published","published":"2024-12-23T20:38:34Z","modified":"2024-12-23T20:56:55.885554Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N","level":"critical"}],"cwes":["CWE-88"],"updated_at":"2026-11-02T15:46:57.348035Z"},{"id":"GO-2024-2969","title":"github.com/gogs/gogs affected by CVE-2024-39930","description":"github.com/gogs/gogs affected by CVE-2024-39930","status":"published","published":"2024-07-09T19:34:07Z","modified":"2026-03-03T04:55:32.517723Z","updated_at":"2026-11-02T15:47:01.453823Z"}]}}
