CVE-2026-45571 go-git: Crafted repositories may modify main and submodule .git directories
Crafted repositories can modify .git directories outside the checkout target, potentially leading to code execution or data modification.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-45571?
CVE-2026-45571 is a medium-severity path traversal vulnerability in go-git, published on 27 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official 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.
Weakness: CWE-22
Which versions are affected by CVE-2026-45571?
7 open source packages ship an affected version, including github.com/go-git/go-git/v5, github.com/go-git/go-git and github.com/go-git/go-git/v6. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/go-git/go-git/v5 Go | All versions | 5.19.1 |
github.com/go-git/go-git/v5 Go | All versions | 5.19.1 |
github.com/go-git/go-git/v5 Go | All versions | 5.19.1 |
github.com/go-git/go-git Go | All versions to 44.7.0 | None |
github.com/go-git/go-git Go | All versions to 44.7.0 | None |
github.com/go-git/go-git/v6 Go | All versions | 6.0.0-alpha.4 |
1 more packages
github.com/go-git/go-git/v6 Go | All versions | 6.0.0-alpha.4 |
Products include Go-Git Project Go-Git.
How do I fix CVE-2026-45571?
Upgrade github.com/go-git/go-git/v5 to 5.19.1 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2026-45571 being exploited?
There is no known exploitation of CVE-2026-45571 in the wild and no public exploit code.
Other vulnerabilities in go-git
- CVE-2023-49569 Maliciously crafted Git server replies can lead to path traversal and RCE on go-git clients
- CVE-2025-21613 go-git has an Argument Injection via the URL field
- CVE-2025-21614 go-git clients vulnerable to DoS via maliciously crafted Git server replies
- CVE-2023-49568 Maliciously crafted Git server replies can cause DoS on go-git clients
- CVE-2026-45022 go-git: Improper parsing of specially crafted objects may lead to inconsistent interpretation compared to upstream Git
Sources
Also known as AZL-88415, AZL-88797, BELL-CVE-2026-45571, CLEANSTART-2026-KV85697, CLEANSTART-2026-NG68167, CLEANSTART-2026-UL53723 and 184 more.