Description
go-git is an extensible git implementation library written in pure Go. Prior to 5.19.1 and 6.0.0-alpha.4, a path validation issue in go-git could allow crafted repository data to affect files outside the intended checkout target, including the repository's .git directory. These validations were introduced in upstream Git years ago, so the vulnerability arose from go-git drifting from those checks. This vulnerability is fixed in 5.19.1 and 6.0.0-alpha.4.
Published: 2026-05-27
Score: 5.4 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

A path validation issue in the pure Go git library permits crafted repository data to write files outside the intended checkout location, including the repository’s own .git directory. This flaw, tagged as CWE-22, means an attacker can supply malicious repository content that, when processed, alters configuration files or metadata inside the .git control structures, potentially altering repository behavior or facilitating further compromise.

Affected Systems

The vulnerability affects the go-git implementation library. All users of go-git with a version earlier than 5.19.1 or 6.0.0-alpha.4 are impacted. Projects that integrate go-git via dependency managers must check their bundled library version. Any application that clones, pulls, or otherwise processes git data through these library versions is susceptible.

Risk and Exploitability

The CVSS score of 5.4 indicates moderate severity. The EPSS score is not available, and the vulnerability is not listed in CISA’s KEV catalog. Based on the description, it is inferred that exploitation requires an attacker to supply a crafted repository, which typically means the victim must clone or pull from a malicious source, so the attack vector is local repository manipulation rather than remote network exploitation. Once the repository is processed, it is inferred that the attacker can modify configuration or state files within the .git directory, potentially leading to privilege escalation or further tampering. Given the lack of a publicly known widespread exploit, the immediate threat level is moderate but should not be ignored.

Generated by OpenCVE AI on May 27, 2026 at 21:11 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the go-git library to version 5.19.1 or later, or to version 6.0.0‑alpha.4 if using the experimental branch
  • Verify that all dependent projects and transitive dependencies are using the patched library version
  • Implement context‑aware validation for repository data, ensuring that any custom or third‑party repositories are scanned for suspicious path entries before clone or pull operations

Generated by OpenCVE AI on May 27, 2026 at 21:11 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-crhj-59gh-8x96 go-git: Crafted repositories may modify main and submodule .git directories
History

Thu, 04 Jun 2026 18:15:00 +0000

Type Values Removed Values Added
First Time appeared Go-git Project
Go-git Project go-git
CPEs cpe:2.3:a:go-git_project:go-git:*:*:*:*:*:go:*:*
cpe:2.3:a:go-git_project:go-git:6.0.0:alpha1:*:*:*:go:*:*
cpe:2.3:a:go-git_project:go-git:6.0.0:alpha2:*:*:*:go:*:*
cpe:2.3:a:go-git_project:go-git:6.0.0:alpha3:*:*:*:go:*:*
Vendors & Products Go-git Project
Go-git Project go-git

Thu, 28 May 2026 02:30:00 +0000

Type Values Removed Values Added
First Time appeared Go-git
Go-git go-git
Vendors & Products Go-git
Go-git go-git

Wed, 27 May 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 27 May 2026 15:15:00 +0000

Type Values Removed Values Added
Description go-git is an extensible git implementation library written in pure Go. Prior to 5.19.1 and 6.0.0-alpha.4, a path validation issue in go-git could allow crafted repository data to affect files outside the intended checkout target, including the repository's .git directory. These validations were introduced in upstream Git years ago, so the vulnerability arose from go-git drifting from those checks. This vulnerability is fixed in 5.19.1 and 6.0.0-alpha.4.
Title go-git: Crafted repositories may modify main and submodule .git directories
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L'}


Subscriptions

Go-git Go-git
Go-git Project Go-git
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-05-27T16:03:30.942Z

Reserved: 2026-05-12T19:00:14.600Z

Link: CVE-2026-45571

cve-icon Vulnrichment

Updated: 2026-05-27T16:03:23.599Z

cve-icon NVD

Status : Analyzed

Published: 2026-05-27T15:16:30.387

Modified: 2026-06-04T18:01:41.563

Link: CVE-2026-45571

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-28T02:15:03Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')