CVE-2023-49568: Github.com/go git/go git/v5 Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-mw99-9chc-xw7r
CVSS 7.5
CWE-20
Published
Advisory Summary

CVE-2023-49568 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-20: Improper Input Validation) affecting Github.com/go git/go git/v5 libraries in the Go ecosystem. The issue involves maliciously crafted git server replies can cause dos on go-git clients. Remediation is available by upgrading affected packages to version 5.11.0.

CVE-2023-49568 at a Glance

CVE Identifier CVE-2023-49568
GHSA Identifier GHSA-mw99-9chc-xw7r
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/go git/go git/v5
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

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

How to Fix CVE-2023-49568

To remediate this vulnerability, upgrade all affected Github.com/go git/go git/v5 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/go-git/go-git/v5 fixed: 5.11.0
Upgrade github.com/go-git/go-git/v5 to 5.11.0
gopkg.in/src-d/go-git.v4 fixed: Latest secure release
Upgrade gopkg.in/src-d/go-git.v4 to Latest secure release
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 github.com/go-git/go-git/v5

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-49568, inspect your project dependencies for Github.com/go git/go git/v5:

inspect dependencies for github.com/go-git/go-git/v5

Analyze the terminal output to locate any version of Github.com/go git/go git/v5 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.11.0), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/go git/go git/v5, 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 A denial of service (DoS) vulnerability was discovered in go-git versions prior to `v5.11`. This vulnerability allows an attacker to perform denial of service attacks by providing specially crafted responses from a Git server which triggers resource exhaustion in `go-git` clients. Applications using only the in-memory filesystem supported by `go-git` are not affected by this vulnerability. This is a `go-git` implementation issue and does not affect the upstream `git` cli. ### Patches Users running versions of `go-git` from `v4` and above are recommended to upgrade to `v5.11` in order to mitigate this vulnerability. ### Workarounds In cases where a bump to the latest version of `go-git` is not possible, we recommend limiting its use to only trust-worthy Git servers. ## Credit Thanks to Ionut Lalu for responsibly disclosing this vulnerability to us. ### References - [GHSA-mw99-9chc-xw7r](https://github.com/go-git/go-git/security/advisories/GHSA-mw99-9chc-xw7r)

CVE-2023-49568 Affected Github.com/go git/go git/v5 Versions

2 component(s)
Fixed Versions:
5.11.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/go-git/go-git/v5
Go
< 5.11.0
5.11.0
gopkg.in/src-d/go-git.v4
Go
≥ 4.7.1
≤ 4.13.1

References

Frequently Asked Questions

What is CVE-2023-49568?
CVE-2023-49568 is a security vulnerability in Github.com/go git/go git/v5 involving Maliciously crafted Git server replies can cause DoS on go-git clients under CWE-20: Improper Input Validation.
Which Github.com/go git/go git/v5 versions are affected?
Affected versions include releases prior to 5.11.0 across affected packages: github.com/go-git/go-git/v5, gopkg.in/src-d/go-git.v4.
What version fixes CVE-2023-49568?
Upgrading to 5.11.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/go-git/go-git/v5 affected?
Yes, github.com/go-git/go-git/v5 is affected in releases prior to 5.11.0. Upgrade your dependency to 5.11.0 or later.
Is gopkg.in/src-d/go-git.v4 affected?
Yes, gopkg.in/src-d/go-git.v4 is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2023-49568?
CVE-2023-49568 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-49568?
CVE-2023-49568 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Go dependencies for CVE-2023-49568?
Run the dependency tree command: 'inspect dependencies for github.com/go-git/go-git/v5'. 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-mw99-9chc-xw7r",
  "modified" : "2025-01-06T15:20:39Z",
  "published" : "2023-12-27T15:06:52Z",
  "aliases" : [ "CVE-2023-49568" ],
  "summary" : "Maliciously crafted Git server replies can cause DoS on go-git clients",
  "details" : "### Impact\nA denial of service (DoS) vulnerability was discovered in go-git versions prior to `v5.11`. This vulnerability allows an attacker to perform denial of service attacks by providing specially crafted responses from a Git server which triggers resource exhaustion in `go-git` clients. \n\nApplications using only the in-memory filesystem supported by `go-git` are not affected by this vulnerability.\nThis is a `go-git` implementation issue and does not affect the upstream `git` cli.\n\n### Patches\nUsers running versions of `go-git` from `v4` and above are recommended to upgrade to `v5.11` in order to mitigate this vulnerability.\n\n### Workarounds\nIn cases where a bump to the latest version of `go-git` is not possible, we recommend limiting its use to only trust-worthy Git servers.\n\n## Credit\nThanks to Ionut Lalu for responsibly disclosing this vulnerability to us.\n\n### References\n- [GHSA-mw99-9chc-xw7r](https://github.com/go-git/go-git/security/advisories/GHSA-mw99-9chc-xw7r)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/go-git/go-git/v5"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.11.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "gopkg.in/src-d/go-git.v4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.7.1"
      }, {
        "last_affected" : "4.13.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-git/go-git/security/advisories/GHSA-mw99-9chc-xw7r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-49568"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-git/go-git"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-12-27T15:06:52Z",
    "nvd_published_at" : "2024-01-12T11:15:12Z"
  }
}