CVE-2024-39930: Critical severity go/github.com/gogs/gogs vulnerability

Published Jul 4, 2024
·
Updated

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

2 affected componentsFixes available
go/github.com/gogs/gogs<=0.13.0
go/gogs.io/gogs<=0.13.0
0.13.1

Event History

Jul 4, 2024
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionSeverity
Data Sourced
via NVD·04:15 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·06:31 PM
Dec 23, 2024
Withdrawn
via GitHub·08:37 PM
Jul 2, 2025
Exploit Published
12:00 AM
Known Exploited
10:37 AM
May 28, 2026
News Published
via BleepingComputer·02:25 PM
News Published
via BleepingComputer·02:26 PM
Jun 8, 2026
News Published
via BleepingComputer·04:18 PM

Frequently Asked Questions

1

What is the severity of CVE-2024-39930?

CVE-2024-39930 is classified as a moderate severity vulnerability.

2

How do I fix CVE-2024-39930?

To mitigate CVE-2024-39930, upgrade Gogs to version 0.13.1 or later.

3

What vulnerabilities does CVE-2024-39930 address?

CVE-2024-39930 addresses argument injection issues in the built-in SSH server of Gogs.

4

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.

5

What type of exploitation does CVE-2024-39930 enable?

CVE-2024-39930 enables remote code execution due to argument injection vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203