CVE-2026-45571 go-git: Crafted repositories may modify main and submodule .git directories

Medium 5.4 Published Updated

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.

PackageAffectedFixed in
github.com/go-git/go-git/v5 GoAll versions5.19.1
github.com/go-git/go-git/v5 GoAll versions5.19.1
github.com/go-git/go-git/v5 GoAll versions5.19.1
github.com/go-git/go-git GoAll versions to 44.7.0None
github.com/go-git/go-git GoAll versions to 44.7.0None
github.com/go-git/go-git/v6 GoAll versions6.0.0-alpha.4
1 more packages
github.com/go-git/go-git/v6 GoAll versions6.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.

Sources

Also known as AZL-88415, AZL-88797, BELL-CVE-2026-45571, CLEANSTART-2026-KV85697, CLEANSTART-2026-NG68167, CLEANSTART-2026-UL53723 and 184 more.

Is CVE-2026-45571 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free