# CVE-2026-45571: go-git path traversal via crafted repository data

Source: https://junglewise.ai/threats/cve-2026-45571-go-git-path-traversal-via-crafted-repository-data  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-27. Updated: 2026-05-27  
License: CC BY 4.0 with a link back

CVE-2026-45571 · Severity: medium · CVSS 5.4 · Published 2026-05-27

go-git is a software library used by developers to build Git-related features into their applications. A security flaw in how the library handles file paths allows a malicious repository to write files outside of the intended folder during a checkout or clone operation. This could allow an attacker to corrupt the repository's internal configuration or overwrite sensitive files on a user's system if they interact with a malicious repository.

Technologies: [github.com/go-git/go-git (Go)](https://junglewise.ai/threats/technologies/github-com-go-git-go-git), [github.com/go-git/go-git/v5 (Go)](https://junglewise.ai/threats/technologies/github-com-go-git-go-git-v5), [github.com/go-git/go-git/v6 (Go)](https://junglewise.ai/threats/technologies/github-com-go-git-go-git-v6), [Go-Git](https://junglewise.ai/threats/technologies/go-git). Vendors: [Go](https://junglewise.ai/threats/vendors/go), [Go-Git](https://junglewise.ai/threats/vendors/go-git).

## Quick answers

**Is CVE-2026-45571 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-45571 being exploited in the wild.

**How severe is CVE-2026-45571?** Medium severity, with a CVSS score of 5.4, published 27 May 2026.

**Which products and versions are affected?** github.com/go-git/go-git (Go) <= 44.7.0, SEMVER:introduced=0,last_affected=44.7.0; github.com/go-git/go-git/v5 (Go) <= 5.19.0, SEMVER:introduced=0,fixed=5.19.1; github.com/go-git/go-git/v6 (Go) <= 6.0.0-alpha.3, SEMVER:introduced=0,fixed=6.0.0-alpha.4; Go-Git <= 5.19.0.

**Is there a fix for CVE-2026-45571?** Yes. github.com/go-git/go-git/v5 (Go): upgrade to 5.19.1 or later; github.com/go-git/go-git/v6 (Go): upgrade to 6.0.0-alpha.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-45571 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-45571?** Check whether you run github.com/go-git/go-git (Go), github.com/go-git/go-git/v5 (Go), github.com/go-git/go-git/v6 (Go) or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- github.com/go-git/go-git/v5 (Go): upgrade to 5.19.1 or later

  ```sh
  go get github.com/go-git/go-git/v5@v5.19.1
  ```

- github.com/go-git/go-git/v6 (Go): upgrade to 6.0.0-alpha.4 or later

  ```sh
  go get github.com/go-git/go-git/v6@v6.0.0-alpha.4
  ```


## Technical details

A path traversal vulnerability (CWE-22) exists in go-git due to insufficient path validation during repository operations. The library failed to maintain parity with upstream Git's security checks, allowing maliciously crafted repository payloads to resolve paths outside of the intended worktree. Depending on the operating system (Windows, macOS, or Linux) and the filesystem implementation used (e.g., osfs vs memfs), an attacker can overwrite files in the parent directory or manipulate the repository's internal .git metadata and submodules. Exploitation requires a user to interact with a malicious repository. The issue is resolved in versions 5.19.1 and 6.0.0-alpha.4.

## Affected products

- go-git go-git/v5 <= 5.19.0
- go-git go-git/v6 <= 6.0.0-alpha.3

## Identifiers

- CVE-2026-45571
- GHSA-crhj-59gh-8x96
- GO-2026-5336

## Timeline

- 2026-05-18: advisory: GitHub Security Advisory published by maintainers.
- 2026-05-27: disclosed: CVE published to NVD.

## References

- [https://github.com/go-git/go-git/security/advisories/GHSA-crhj-59gh-8x96](https://github.com/go-git/go-git/security/advisories/GHSA-crhj-59gh-8x96)

## Related threats

- [go-git path traversal via malicious reference names](https://junglewise.ai/threats/cve-2026-71557-go-git-path-traversal-via-malicious-reference-names)
- [go-git symlink traversal in worktree operations](https://junglewise.ai/threats/cve-2026-71556-go-git-symlink-traversal-in-worktree-operations)
- [GO-2026-5693 - Go-git: Malformed Git object data may cause panics or resource exhaustion in github.com/go-git/go-git](https://junglewise.ai/threats/go-2026-5693-go-git-malformed-git-object-data-may-cause-panics-or-9c82fa09)
- [go-git go-billy denial of service via improper input handling](https://junglewise.ai/threats/cve-2026-44740-go-git-go-billy-denial-of-service-via-improper-input-handling)
- [go-git DoS via malformed Git object data](https://junglewise.ai/threats/go-git-dos-via-malformed-git-object-data-a3075e9b)
