CVE-2024-39933: Gogs.io/gogs Gogs Allows Argument Injection When Vulnerability

HIGH
Advisory Identifier: GHSA-m27m-h5gj-wwmg
CVSS 7.7
CWE-88
Published
Advisory Summary

CVE-2024-39933 is a HIGH (CVSS 7.7) gogs allows argument injection when 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 allows argument injection when tagging new releases. Remediation is available by upgrading affected packages to version 0.13.1.

CVE-2024-39933 at a Glance

CVE Identifier CVE-2024-39933
GHSA Identifier GHSA-m27m-h5gj-wwmg
Severity HIGH
CVSS v3.1 Base Score 7.7
CWE Classification CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
Affected Product Gogs.io/gogs
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AC:L/AV:N/A:N/C:H/I:N/PR:L/S:C/UI:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-39933

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.

gogs.io/gogs fixed: 0.13.1
Upgrade gogs.io/gogs to 0.13.1
Verify Direct and Transitive Dependencies

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-39933, 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

### Impact Unprivileged user accounts with at least one SSH key can read arbitrary files on the system. For instance, they could leak the configuration files that could contain database credentials (`[database] *`) and `[security] SECRET_KEY`. Attackers could also exfiltrate TLS certificates, other users' repositories, and the Gogs database when the SQLite driver is enabled. ### Patches Unintended Git options has been ignored for creating tags (https://github.com/gogs/gogs/pull/7872). Users should upgrade to 0.13.1 or the latest 0.14.0+dev. ### Workarounds No viable workaround available, please only grant access to trusted users to your Gogs instance on affected versions. ### References https://www.cve.org/CVERecord?id=CVE-2024-39933

CVE-2024-39933 Affected Gogs.io/gogs Versions

1 component(s)
Fixed Versions:
0.13.1
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-39933?
CVE-2024-39933 is a security vulnerability in Gogs.io/gogs involving Gogs allows argument Injection when tagging new releases under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection').
Which Gogs.io/gogs versions are affected?
Affected versions include releases prior to 0.13.1 across affected packages: gogs.io/gogs.
What version fixes CVE-2024-39933?
Upgrading to 0.13.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gogs.io/gogs affected?
Yes, gogs.io/gogs is affected in releases prior to 0.13.1. Upgrade your dependency to 0.13.1 or later.
What is the CVSS score of CVE-2024-39933?
CVE-2024-39933 has a CVSS v3.1 base score of 7.7 (HIGH) with vector string CVSS:3.1/AC:L/AV:N/A:N/C:H/I:N/PR:L/S:C/UI:N.
What CWE is associated with CVE-2024-39933?
CVE-2024-39933 is classified under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') (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.).
How can I check Go dependencies for CVE-2024-39933?
Run the dependency tree command: 'inspect dependencies for gogs.io/gogs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m27m-h5gj-wwmg",
  "modified" : "2024-12-23T20:38:12Z",
  "published" : "2024-12-23T20:38:12Z",
  "aliases" : [ "CVE-2024-39933" ],
  "summary" : "Gogs allows argument Injection when tagging new releases",
  "details" : "### Impact\n\nUnprivileged user accounts with at least one SSH key can read arbitrary files on the system. For instance, they could leak the configuration files that could contain database credentials (`[database] *`) and `[security] SECRET_KEY`. Attackers could also exfiltrate TLS certificates, other users' repositories, and the Gogs database when the SQLite driver is enabled.\n\n### Patches\n\nUnintended Git options has been ignored for creating tags (https://github.com/gogs/gogs/pull/7872). Users should upgrade to 0.13.1 or the latest 0.14.0+dev.\n\n### Workarounds\n\nNo viable workaround available, please only grant access to trusted users to your Gogs instance on affected versions.\n\n### References\n\nhttps://www.cve.org/CVERecord?id=CVE-2024-39933\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AC:L/AV:N/A:N/C:H/I:N/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-m27m-h5gj-wwmg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-39933"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/pull/7872"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/commit/76831d0d06c44c5cf46dc22b380440b7507c2f07"
  }, {
    "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-88" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-23T20:38:12Z",
    "nvd_published_at" : null
  }
}