Every CVE Search/ Get API key

CVE-2024-39930

Duplicate Advisory: github.com/gogs/gogs affected by CVE-2024-39930

9.9 CriticalPublic exploitFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
Low
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

7.74%Up 7.7 points since Jul 5, 2024
90%50%10%1%

What each source reports

CVE List Score used 9.9

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.

Record
CVE-2024-39930
CVSS 3.1
9.9 CriticalCVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N
Weakness
CWE-88
Updated
2026-11-02
EUVDEUVD-2024-3615 9.9

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.

Record
EUVD-2024-3615
CVSS 3.1
9.9 CriticalCVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N
Updated
2026-11-03
GitHub AdvisoriesGHSA-p69r-v3h4-rj4f 9.4

Duplicate Advisory: github.com/gogs/gogs affected by CVE-2024-39930

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.

Record
GHSA-p69r-v3h4-rj4f
CVSS 4.0
9.4 CriticalCVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
CVSS 3.1
9.9 CriticalCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Weakness
CWE-88
Updated
2026-11-02
GitHub AdvisoriesGHSA-vm62-9jw3-c8w3 9.9

Gogs has an argument Injection in the built-in SSH server

Impact

When 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.

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

Record
GHSA-vm62-9jw3-c8w3
CVSS 3.1
9.9 CriticalCVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N
Weakness
CWE-88
Updated
2026-11-02
NVD 9.9

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.

Record
CVE-2024-39930
CVSS 3.1
9.9 CriticalCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Weakness
CWE-88
Updated
2026-11-02
OSV 9.9

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.

Record
CVE-2024-39930
CVSS 3.1
9.9 CriticalCVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N
Updated
2026-11-02
OSVGHSA-p69r-v3h4-rj4f 9.4

Duplicate Advisory: github.com/gogs/gogs affected by CVE-2024-39930

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.

Record
GHSA-p69r-v3h4-rj4f
CVSS 4.0
9.4 CriticalCVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
CVSS 3.1
9.9 CriticalCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Weakness
CWE-88
Updated
2026-11-02
OSVGHSA-vm62-9jw3-c8w3 9.9

Gogs has an argument Injection in the built-in SSH server

Impact

When 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.

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

Record
GHSA-vm62-9jw3-c8w3
CVSS 3.1
9.9 CriticalCVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N
Weakness
CWE-88
Updated
2026-11-02
OSVGO-2024-2969 No score

github.com/gogs/gogs affected by CVE-2024-39930

github.com/gogs/gogs affected by CVE-2024-39930

Record
GO-2024-2969
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
gogs.io/gogs
Go
through 0.13.0
0.13.1
gogs.io/gogs
Go
before 0.13.1
0.13.1
github.com/gogs/gogs
Go
All versions None known

Public exploits

Links only. Every CVE stores no exploit code.

Public exploits
SourceLinkDate
Exploit-DBgogs 0.13.0 - Remote Code Execution (RCE)2025-07-02
PoC in GitHubalexander47777/-CVE-2024-399302025-07-22
PoC in GitHublaachy/CVE-2024-39930-ptrace-detection-mitigation2025-10-13
PoC in GitHubtheMcSam/CVE-2024-39930-PoC2025-06-29

History

History
RecordedChangedSources
affected
aliasesEUVD
first indexedCVE List, Exploit-DB, GitHub Advisories, NVD, OSV, PoC in GitHub

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2024-39930 is a critical vulnerability (CVSS 9.9) in Gogs, published July 4, 2024. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 7.74%, the 94th percentile. Fixed in gogs.io/gogs 0.13.1.

References

MoveEnter Open