CVE-2026-34165: go-git Maliciously Crafted Idx File Can Vulnerability
MODERATECVE-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
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).
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.
Upgrade github.com/go-git/go-git/v5 to 5.17.1
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
CVE-2026-34165 Affected go-git Versions
1 component(s)| 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?
Which go-git versions are affected?
What version fixes CVE-2026-34165?
Is github.com/go-git/go-git/v5 affected?
What is the CVSS score of CVE-2026-34165?
What CWE is associated with CVE-2026-34165?
How can I check Go dependencies for CVE-2026-34165?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}