CVE-2024-39930: Gogs.io/gogs Gogs Has An Argument Injection Vulnerability
CRITICALCVE-2024-39930 is a CRITICAL (CVSS 9.9) gogs has an argument injection vulnerability (CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')) affecting Gogs.io/gogs libraries in the Go ecosystem. The issue involves gogs has an argument injection in the built-in ssh server. Remediation is available by upgrading affected packages to version 0.13.1.
CVE-2024-39930 at a Glance
Security Impact
CVSS: 9.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N).
How to Fix CVE-2024-39930
To remediate this vulnerability, upgrade all affected Gogs.io/gogs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade gogs.io/gogs to 0.13.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for gogs.io/gogs
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-39930, inspect your project dependencies for Gogs.io/gogs:
inspect dependencies for gogs.io/gogs
Analyze the terminal output to locate any version of Gogs.io/gogs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.13.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection'), where the product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string. In Gogs.io/gogs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-39930 Affected Gogs.io/gogs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
gogs.io/gogs
|
Go |
< 0.13.1
|
0.13.1
|
References
Frequently Asked Questions
What is CVE-2024-39930?
Which Gogs.io/gogs versions are affected?
What version fixes CVE-2024-39930?
Is gogs.io/gogs affected?
What is the CVSS score of CVE-2024-39930?
What CWE is associated with CVE-2024-39930?
How can I check Go dependencies for CVE-2024-39930?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vm62-9jw3-c8w3",
"modified" : "2024-12-23T20:38:34Z",
"published" : "2024-12-23T20:38:34Z",
"aliases" : [ "CVE-2024-39930" ],
"summary" : "Gogs has an argument Injection in the built-in SSH server",
"details" : "### 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",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "gogs.io/gogs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.13.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.13.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/gogs/gogs/security/advisories/GHSA-vm62-9jw3-c8w3"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gogs/gogs"
}, {
"type" : "WEB",
"url" : "https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1"
}, {
"type" : "WEB",
"url" : "https://www.vicarius.io/vsociety/posts/argument-injection-in-gogs-ssh-server-cve-2024-39930"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-88" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-12-23T20:38:34Z",
"nvd_published_at" : null
}
}