Skip to content

← Actionable
Low, CVSS 2.3

go-git: Improper single-quote escaping in go-git SSH transport

CVE-2026-45570GHSA-m7cr-m3pv-hgrp

What to do

Partial vendor fix. Follow the primary source's mitigation guidance and check back for a fix.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

  • Go github.com/go-git/go-git/v6

    Affected
    <= 6.0.0-alpha.3
    Fixed in
    6.0.0-alpha.4
  • Go github.com/go-git/go-git/v5

    Affected
    <= 5.19.0
    Fixed in
    5.19.1
  • Go github.com/go-git/go-git

    Affected
    <= 4.7.0
    Fixed in
    no fixed version recorded

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS 4.0
2.3 · 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 · score source
EPSS
  • CVE-2026-45570: 0.36% estimated exploitation activity in the next 30 days; percentile 30.45 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Impact 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. This diverges from canonical Git, which shell-quotes the path through sqquotebuf so that an embedded ' becomes the '\'' close-escape-reopen sequence and the whole path round-trips as a single quoted argument. 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. On SSH servers that evaluate the exec command through a shell (for example a user account whose login shell is /bin/sh or /bin/bash, or a ForceCommand wrapper that re-evaluates $SSHORIGINALCOMMAND), those additional tokens execute in that account's command-execution context. SSH servers that tokenize the exec command without shell evaluation, including the canonical git-shell setup, are not affected. The vulnerable behaviour is on the SSH server side, not in…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 1 · created ·

    Published from ghsa record GHSA-m7cr-m3pv-hgrp

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-45570

Advisory: go-git: Improper single-quote escaping in go-git SSH transport
IDs: CVE-2026-45570, GHSA-m7cr-m3pv-hgrp
Record: https://patchnext.com/advisories/cve-2026-45570 (revision 1, source checked 26 Oct 2026, 15:23 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Low (CVSS 2.3)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Partial vendor fix; fixed versions by package: github.com/go-git/go-git/v6 6.0.0-alpha.4; github.com/go-git/go-git/v5 5.19.1. A vendor fix does not mean a deployment is fixed.

## Affected components
- Go github.com/go-git/go-git/v6: affected <= 6.0.0-alpha.3; fixed in 6.0.0-alpha.4
- Go github.com/go-git/go-git/v5: affected <= 5.19.0; fixed in 5.19.1
- Go github.com/go-git/go-git: affected <= 4.7.0

## Suggested inspection (read-only)
- Go github.com/go-git/go-git/v6: check the installed version with your package manager.
- Go github.com/go-git/go-git/v5: check the installed version with your package manager.
- Go github.com/go-git/go-git: check the installed version with your package manager.

## Supported action
No complete vendor fix is recorded. Follow the primary source's mitigation guidance and check this record again before closing anything.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on github.com/go-git/go-git/v6, github.com/go-git/go-git/v5, github.com/go-git/go-git.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://github.com/advisories/GHSA-m7cr-m3pv-hgrp (GitHub-reviewed advisory GHSA-m7cr-m3pv-hgrp lists affected ranges: Go github.com/go-git/go-git/v5 >=0 =0 =0 <=4.7.0)

Commands are suggestions: review each one before running it.

Loading voting…