{"id":"CVE-2024-39930","aliases":["CVE-2024-39930","GHSA-p69r-v3h4-rj4f","GHSA-vm62-9jw3-c8w3","GO-2024-2969"],"related":[],"kind":"vulnerability","state":"published","title":"Gogs has an argument Injection in the built-in SSH server","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"# 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"### 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","format":"markdown","source":"ghsa"},{"lang":"en","text":"github.com/gogs/gogs affected by CVE-2024-39930","format":"markdown","source":"go"},{"lang":"es","text":"El servidor SSH integrado de Gogs hasta la versión 0.13.0 permite la inyección de argumentos en internal/ssh/ssh.go, lo que lleva a la ejecución remota de código. Los atacantes autenticados pueden aprovechar esto abriendo una conexión SSH y enviando una solicitud env maliciosa de cadena dividida si el servidor SSH integrado está activado. Las instalaciones de Windows no se ven afectadas.","source":"nvd"}],"published":"2024-07-04T00:00:00.000Z","modified":"2026-06-17T07:43:03.143Z","severity":{"scorer":"mitre","scheme":"CVSS:3.1","vector":"CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N","score":9.9,"rating":"CRITICAL"},"severities":[{"scorer":"mitre","scheme":"CVSS:3.1","vector":"CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N","score":9.9,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":9.9,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N","score":9.9,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":9.9,"rating":"CRITICAL"}],"cwes":["CWE-88"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","lastAffected":"0.13.0","status":"affected"}],"vendor":"gogs","product":"gogs","cpe":"cpe:2.3:a:gogs:gogs:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"0.13.0"}],"ecosystem":"Go","package":"github.com/gogs/gogs","purl":"pkg:golang/github.com/gogs/gogs","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.13.1"}],"ecosystem":"Go","package":"gogs.io/gogs","purl":"pkg:golang/gogs.io/gogs","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/gogs/gogs","purl":"pkg:golang/github.com/gogs/gogs","source":"go"},{"ranges":[{"status":"affected","lastAffected":"0.13.0"}],"vendor":"gogs","product":"gogs","cpe":"cpe:2.3:a:gogs:gogs:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/gogs/gogs/releases","tags":["release-notes","web","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1/","tags":["third-party-advisory","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://www.vicarius.io/vsociety/posts/argument-injection-in-gogs-ssh-server-cve-2024-39930","tags":["exploit","third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-39930","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/gogs/gogs","tags":["package"],"sources":["ghsa"]},{"url":"https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/gogs/gogs/security/advisories/GHSA-vm62-9jw3-c8w3","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-p69r-v3h4-rj4f","tags":["advisory"],"sources":["go"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2024-08-12T18:33:50.332Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-39930","url":"https://www.cve.org/CVERecord?id=CVE-2024-39930","licence":"CVE Terms of Use","modified":"2024-08-28T15:22:31.592Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p69r-v3h4-rj4f","url":"https://github.com/advisories/GHSA-p69r-v3h4-rj4f","licence":"CC-BY-4.0","modified":"2024-12-23T20:56:55.885Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vm62-9jw3-c8w3","url":"https://github.com/advisories/GHSA-vm62-9jw3-c8w3","licence":"CC-BY-4.0","modified":"2024-12-23T20:56:55.885Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2024-2969","url":"https://pkg.go.dev/vuln/GO-2024-2969","licence":"CC-BY-4.0","modified":"2026-03-03T04:55:32.517Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-39930","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-39930","licence":"Public domain","modified":"2026-06-17T07:43:03.143Z"}],"updatedAt":"2026-11-25T22:58:42.509Z","epss":{"score":0.07681,"percentile":0.94726,"date":"2026-12-01T12:00:22.000Z"}}