CVE-2026-45571
Analyzed Analyzed - Analysis Complete
Path Traversal in go-git Library

Publication date: 2026-05-27

Last updated on: 2026-06-04

Assigner: GitHub, Inc.

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-05-27
Last Modified
2026-06-04
Generated
2026-06-16
AI Q&A
2026-05-27
EPSS Evaluated
2026-06-15
NVD
EUVD
Affected Vendors & Products
Showing 4 associated CPEs
Vendor Product Version / Range
go-git_project go-git 6.0.0
go-git_project go-git to 5.19.1 (exc)
go-git_project go-git 6.0.0
go-git_project go-git 6.0.0
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Compliance Impact

The vulnerability in go-git allows crafted repository data to modify files outside the intended checkout target, including the repository's .git directory. This could potentially lead to unauthorized modification of files, which may impact data integrity and security controls.

However, there is no explicit information provided about how this vulnerability directly affects compliance with common standards and regulations such as GDPR or HIPAA.

Executive Summary

The vulnerability in go-git is due to a path validation issue that existed prior to versions 5.19.1 and 6.0.0-alpha.4. This flaw allows specially crafted repository data to affect files outside the intended checkout target directory, including the repository's .git directory. The problem arose because go-git did not maintain the same path validation checks that upstream Git had implemented years ago.

Impact Analysis

This vulnerability can impact you by allowing an attacker to manipulate files outside the intended checkout directory when using go-git. This could lead to unauthorized modification of files, including those in the .git directory, potentially compromising the integrity of the repository or the system using it.

Mitigation Strategies

To mitigate this vulnerability, upgrade the go-git library to version 5.19.1 or later, or to 6.0.0-alpha.4 or later, where the path validation issue has been fixed.

Detection Guidance

Detection of this vulnerability involves identifying usage of vulnerable go-git versions (prior to 5.19.1 and 6.0.0-alpha.4) and checking for suspicious repository data that attempts path traversal outside the intended checkout target.

Since the vulnerability arises from crafted repository data exploiting path validation issues, you can detect it by:

  • Checking the version of go-git in use to ensure it is 5.19.1 or later, or 6.0.0-alpha.4 or later.
  • Scanning repositories for unusual file paths that attempt to write outside the repository directory, especially paths that traverse upwards (e.g., containing "../").

Suggested commands to check go-git version or scan for suspicious paths depend on your environment and usage, but examples include:

  • To check go-git version in a Go project: `go list -m github.com/go-git/go-git` or check your go.mod file for the version.
  • To find suspicious paths in repository data, you can search for path traversal patterns in repository files, for example using grep: `grep -r '\.\./' /path/to/repository`.
  • Monitor logs or alerts for unexpected file modifications outside the repository directory, especially in the .git directory.

Ultimately, upgrading to the fixed versions is the recommended mitigation.

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-45571. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart