CVE-2026-45570 go-git: Improper single-quote escaping in go-git SSH transport

Low 2.3 Published Updated

Attackers can execute arbitrary commands via crafted repository paths in go-git SSH transport due to improper quote escaping.

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-45570?

CVE-2026-45570 is a low-severity command injection 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, go-git's SSH transport constructs the remote exec command by wrapping the repository path in single quotes without escaping single quotes embedded inside the path. A repository path containing a single quote can therefore break out of the quoted region in the exec command and be appended as additional shell tokens. This vulnerability is fixed in 5.19.1 and 6.0.0-alpha.4.

Weakness: CWE-116

Which versions are affected by CVE-2026-45570?

9 open source packages ship an affected version, including github.com/go-git/go-git, github.com/go-git/go-git/v5 and github.com/go-git/go-git/v6. It affects 1 product.

PackageAffectedFixed in
github.com/go-git/go-git GoAll versionsNone
github.com/go-git/go-git GoAll versions to 4.7.0None
github.com/go-git/go-git GoAll versions to 4.7.0None
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
3 more packages
github.com/go-git/go-git/v6 GoAll versions6.0.0-alpha.4
github.com/go-git/go-git/v6 GoAll versions6.0.0-alpha.4
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-45570?

Upgrade to a fixed version.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2026-45570 being exploited?

There is no known exploitation of CVE-2026-45570 in the wild and no public exploit code.

Sources

Also known as AZL-88418, AZL-88800, BELL-CVE-2026-45570, CLEANSTART-2026-LG29530, CLEANSTART-2026-MD00840, CLEANSTART-2026-OJ94675 and 186 more.

Is CVE-2026-45570 in your software?

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

Check your SBOMs for free