CVE-2024-39930: Critical severity go/github.com/gogs/gogs vulnerability
Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-vm62-9jw3-c8w3. This link is maintained to preserve external references.
Original 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.
Other sources
Impact
When the built-in SSH server is enabled ([server] STARTSSHSERVER = 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 RUNUSER in the configuration. It allows attackers to access and alter any users' code hosted on the same instance.
Patches
The 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.
Workarounds
Disable the use of built-in SSH server on operating systems other than Windows.
References
https://www.cve.org/CVERecord?id=CVE-2024-39930
— GitHub
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2024-39930?
CVE-2024-39930 is classified as a moderate severity vulnerability.
How do I fix CVE-2024-39930?
To mitigate CVE-2024-39930, upgrade Gogs to version 0.13.1 or later.
What vulnerabilities does CVE-2024-39930 address?
CVE-2024-39930 addresses argument injection issues in the built-in SSH server of Gogs.
Which versions of Gogs are affected by CVE-2024-39930?
Gogs versions up to and including 0.13.0 are affected by CVE-2024-39930.
What type of exploitation does CVE-2024-39930 enable?
CVE-2024-39930 enables remote code execution due to argument injection vulnerability.