CVE-2026-34165: go-git Maliciously Crafted Idx File Can Vulnerability

MODERATE
Advisory Identifier: GHSA-jhf3-xxhw-2wpp
CVSS 5.0
CWE-191 CWE-770
Published
Advisory Summary

CVE-2026-34165 is a MODERATE (CVSS 5.0) maliciously crafted idx file can vulnerability (CWE-191: Integer Underflow (Wrap or Wraparound)) affecting go-git libraries in the Go ecosystem. The issue involves maliciously crafted idx file can cause asymmetric memory consumption. Remediation is available by upgrading affected packages to version 5.17.1.

CVE-2026-34165 at a Glance

CVE Identifier CVE-2026-34165
GHSA Identifier GHSA-jhf3-xxhw-2wpp
Severity MODERATE
CVSS v3.1 Base Score 5.0
CWE Classification CWE-191: Integer Underflow (Wrap or Wraparound)
Affected Product go-git
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.0

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

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

How to Fix CVE-2026-34165

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.17.1
Upgrade github.com/go-git/go-git/v5 to 5.17.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 github.com/go-git/go-git/v5

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-34165, 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.17.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-191: Integer Underflow (Wrap or Wraparound), where the product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result. 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 A vulnerability has been identified in which a maliciously crafted `.idx` file can cause asymmetric memory consumption, potentially exhausting available memory and resulting in a Denial of Service (DoS) condition. Exploitation requires write access to the local repository's `.git` directory, it order to create or alter existing `.idx` files. ### Patches Users should upgrade to `v5.17.1`, or the latest `v6` [pseudo-version](https://go.dev/ref/mod#pseudo-versions), in order to mitigate this vulnerability. ### Credit The go-git maintainers thank @kq5y for finding and reporting this issue privately to the `go-git` project.

CVE-2026-34165 Affected go-git Versions

1 component(s)
Fixed Versions:
5.17.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/go-git/go-git/v5
Go
≥ 5.0.0
< 5.17.1
5.17.1

References

Frequently Asked Questions

What is CVE-2026-34165?
CVE-2026-34165 is a security vulnerability in go-git involving Maliciously crafted idx file can cause asymmetric memory consumption under CWE-191: Integer Underflow (Wrap or Wraparound).
Which go-git versions are affected?
Affected versions include releases prior to 5.17.1 across affected packages: github.com/go-git/go-git/v5.
What version fixes CVE-2026-34165?
Upgrading to 5.17.1 (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.17.1. Upgrade your dependency to 5.17.1 or later.
What is the CVSS score of CVE-2026-34165?
CVE-2026-34165 has a CVSS v3.1 base score of 5.0 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-34165?
CVE-2026-34165 is classified under CWE-191: Integer Underflow (Wrap or Wraparound) (The product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result.).
How can I check Go dependencies for CVE-2026-34165?
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-jhf3-xxhw-2wpp",
  "modified" : "2026-03-31T18:50:40Z",
  "published" : "2026-03-30T17:17:54Z",
  "aliases" : [ "CVE-2026-34165" ],
  "summary" : "go-git: Maliciously crafted idx file can cause asymmetric memory consumption",
  "details" : "### Impact\n\nA vulnerability has been identified in which a maliciously crafted `.idx` file can cause asymmetric memory consumption, potentially exhausting available memory and resulting in a Denial of Service (DoS) condition.\n\nExploitation requires write access to the local repository's `.git` directory, it order to create or alter existing `.idx` files. \n\n### Patches\n\nUsers should upgrade to `v5.17.1`, or the latest `v6` [pseudo-version](https://go.dev/ref/mod#pseudo-versions), in order to mitigate this vulnerability.\n\n### Credit\n\nThe go-git maintainers thank @kq5y for finding and reporting this issue privately to the `go-git` project.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/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" : "5.0.0"
      }, {
        "fixed" : "5.17.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.17.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-git/go-git/security/advisories/GHSA-jhf3-xxhw-2wpp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34165"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-git/go-git"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-git/go-git/releases/tag/v5.17.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-191", "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-30T17:17:54Z",
    "nvd_published_at" : "2026-03-31T15:16:17Z"
  }
}