Shell Command Injection in go-git for SSH Transport
CVE-2026-45570
2.3LOW
What is CVE-2026-45570?
The go-git library, which enables extensible git implementations in pure Go, contains a vulnerability that impacts its SSH transport mechanism. This issue arises when forming remote exec commands; the repository path is enclosed in single quotes but fails to escape any single quotes within the path itself. As a result, attackers could exploit this flaw to inject additional shell tokens and potentially execute arbitrary commands. Users are advised to upgrade to versions 5.19.1 or 6.0.0-alpha.4, where this vulnerability has been addressed.
Affected Version(s)
go-git < 5.19.1 < 5.19.1
go-git >= 6.0.0-alpha.1, < 6.0.0-alpha.4 < 6.0.0-alpha.1, 6.0.0-alpha.4
