GHSA-w5pp-99ch-qj29: go-git Remote Code Execution Vulnerability

MODERATE
CVSS 6.5
CWE-400
Published
Advisory Summary

GHSA-w5pp-99ch-qj29 is a MODERATE (CVSS 6.5) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting go-git libraries in the Go ecosystem. The issue involves malformed git object data may cause panics or resource exhaustion. Remediation is available by upgrading affected packages to version 5.19.1, 6.0.0-alpha.4.

GHSA-w5pp-99ch-qj29 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-w5pp-99ch-qj29
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product go-git
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.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:R/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 Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix GHSA-w5pp-99ch-qj29

To remediate this vulnerability, upgrade all affected go-git 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.19.1
Upgrade github.com/go-git/go-git/v5 to 5.19.1
github.com/go-git/go-git/v6 fixed: 6.0.0-alpha.4
Upgrade github.com/go-git/go-git/v6 to 6.0.0-alpha.4
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 GHSA-w5pp-99ch-qj29, inspect your project dependencies for go-git:

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

Analyze the terminal output to locate any version of go-git in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.19.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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In go-git, 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 Several denial-of-service issues were identified in `go-git` when parsing maliciously crafted Git repository data. An attacker may craft a malicious `.pack`, `.idx` or loose objects that causes an application using an affected version of `go-git` to panic or consume excessive resources. This can lead to denial of service in applications that use `go-git` to clone, fetch, open, or otherwise process untrusted repositories or Git object data. Exploitation requires the ability to alter read-only files such as `.pack` or `.idx` from the local repository's `.git/objects/pack/` directory. Alternatively, the user would need to be interacting with a malicious remote server, which is not recommended and exposes users to a broader class of security risks beyond this issue. ### Patches Users should upgrade to a patched version in order to mitigate this vulnerability. Versions prior to `v5` are likely to be affected, users are recommended to upgrade to a supported `go-git` version. ### Credits go-git thanks @kodareef5, @AyushParkara and @N0zoM1z0 for reporting this in four separate reports. 🙇

GHSA-w5pp-99ch-qj29 Affected go-git Versions

2 component(s)
Fixed Versions:
5.19.16.0.0-alpha.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/go-git/go-git/v5
Go
< 5.19.1
5.19.1
github.com/go-git/go-git/v6
Go
< 6.0.0-alpha.4
6.0.0-alpha.4

References

Frequently Asked Questions

What is GHSA-w5pp-99ch-qj29?
GHSA-w5pp-99ch-qj29 is a security vulnerability in go-git involving Malformed Git object data may cause panics or resource exhaustion under CWE-400: Uncontrolled Resource Consumption.
Which go-git versions are affected?
Affected versions include releases prior to 5.19.1, 6.0.0-alpha.4 across affected packages: github.com/go-git/go-git/v5, github.com/go-git/go-git/v6.
What version fixes GHSA-w5pp-99ch-qj29?
Upgrading to 5.19.1, 6.0.0-alpha.4 (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.19.1. Upgrade your dependency to 5.19.1 or later.
Is github.com/go-git/go-git/v6 affected?
Yes, github.com/go-git/go-git/v6 is affected in releases prior to 6.0.0-alpha.4. Upgrade your dependency to 6.0.0-alpha.4 or later.
What is the CVSS score of GHSA-w5pp-99ch-qj29?
GHSA-w5pp-99ch-qj29 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with GHSA-w5pp-99ch-qj29?
GHSA-w5pp-99ch-qj29 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Go dependencies for GHSA-w5pp-99ch-qj29?
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-w5pp-99ch-qj29",
  "modified" : "2026-05-29T19:43:27Z",
  "published" : "2026-05-29T19:43:27Z",
  "aliases" : [ ],
  "summary" : "go-git: Malformed Git object data may cause panics or resource exhaustion",
  "details" : "### Impact\nSeveral denial-of-service issues were identified in `go-git` when parsing maliciously crafted Git repository data.\n\nAn attacker may craft a malicious `.pack`, `.idx` or loose objects that causes an application using an affected version of `go-git` to panic or consume excessive resources.\n\nThis can lead to denial of service in applications that use `go-git` to clone, fetch, open, or otherwise process untrusted repositories or Git object data.\n\nExploitation requires the ability to alter read-only files such as `.pack` or `.idx` from the local repository's `.git/objects/pack/` directory. Alternatively, the user would need to be interacting with a malicious remote server, which is not recommended and exposes users to a broader class of security risks beyond this issue.\n\n### Patches\nUsers should upgrade to a patched version in order to mitigate this vulnerability. Versions prior to `v5` are likely to be affected, users are recommended to upgrade to a supported `go-git` version.\n\n### Credits\ngo-git thanks @kodareef5, @AyushParkara and @N0zoM1z0 for reporting this in four separate reports. 🙇",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/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.19.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.19.0"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/go-git/go-git/v6"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.0.0-alpha.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.0.0-alpha.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-git/go-git/security/advisories/GHSA-w5pp-99ch-qj29"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-git/go-git"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-29T19:43:27Z",
    "nvd_published_at" : null
  }
}