Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-45570

go-git: Improper single-quote escaping in go-git SSH transport
Back to all
CVE

CVE-2026-45570

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

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 go-git: the same bytes can be produced by any SSH client. The change in go-git is defense-in-depth that restores parity with canonical Git's wire format and prevents go-git from being a vehicle for reaching shell-evaluating servers through attacker-influenced repository paths.

Patches

Users should upgrade to a patched version in order to mitigate this issue. The fix ports sqquotebuf from canonical Git into go-git's SSH transport so that the wire output is byte-identical to what git itself would send for the same input.

Versions prior to v5 are likely to be affected, users are recommended to upgrade to a supported go-git version.

Credit

Thanks to @N0zoM1z0 for reporting this to the go-git project. :bow:

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
2.3
-
4.0
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
C
H
U
0
-
C
H
U
-

Related Resources

No items found.

References

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

Severity

9.6

CVSS Score
0
10

Basic Information

Ecosystem
Base CVSS
9.6
EPSS Probability
0.00018%
EPSS Percentile
0.04833%
Introduced Version
0
Fix Available
5.19.1,6.0.0-alpha.4,0.2.88-r4,3.3.4364.0-r2,3.3.4515.0-r1,1.2.13-r1,3.2.12-r1,3.3.10-r3,3.4.2-r2,3.2.12-r4,3.3.10-r4,3.4.2-r4,1.9.10-r22,1.9.10-r16,3.7.14-r4,4.0.5-r5,1.2.1-r1,1.2.0-r6,0.7.1-r20,0.53.0-r4,0.53.0-r2,0.2.263-r1,0.2.264-r1,1.98.2-r1,8.17.10-r20,8.19.15-r3,9.0.8-r23,9.1.10-r16,9.2.8-r3,9.3.4-r5,9.4.1-r1,8.17.10-r25,8.19.15-r1,9.0.8-r26,9.1.10-r19,9.3.4-r4,2.32.4-r2,2.32.4-r1,1.20.7-r4,2.0.8-r3,2.1.5-r4,2.2.1-r3,2.2.1-r4,0.20.8-r6,2.2.0-r10,2.3.0-r8,2.4.1-r5,2.5.0-r1,2.3.0-r6,2.4.1-r3,2.6.4-r25,2.7.5-r18,2.8.8-r0,2.6.4-r22,2.7.5-r19,1.1.4-r0,18.10.6-r3,18.11.4-r1,18.9.7-r3,18.10.6-r1,18.11.3-r1,18.9.7-r1,1.26.2-r0,1.26.2-r1,18.11.3-r3,18.10.6-r2,18.11.3-r4,18.9.7-r2,18.10.1-r9,18.11.3-r2,18.9.0-r13,18.10.1-r10,18.11.3-r5,0.16.0-r4,4.3.3-r15,5.1.0-r4,4.3.3-r14,20251028.00-r18,2.15.4-r5,0.9.9-r156,1.16.1-r1,0.112.0-r3,0.53.3-r3,2.104.0-r1,0.50.18-r25,0.50.18-r19,1.25.15-r1,1.10.4-r1,1.130.4-r2,4.0.8-r4,4.0.8-r5,1.10.8-r7,1.10.8-r8,1.15.3-r19,1.16.4-r5,1.17.2-r6,1.18.1-r1,1.15.20-r5,1.16.4-r4,1.17.2-r5,0.0.0_git20260426-r3,0.0.0_git20260426-r2,0.50.7-r1,2.46.3-r3,3.8.0-r7,2.3.8-r2,1.15.3-r5,1.15.3-r4,3.243.0-r0,2.7.0-r6,3.106.2-r2,1.28.0-r1,1.34.0-r2,0.15.2-r0,0.15.1-r4,3.7.3-r0,5.5.0-r5,2.20.0-r1,1.1304.3-r3,0.19.0-r51,0.19.0-r34,2.4.3-r1,1.44.0-r4,1.44.0-r3,17.7.24-r0,18.8.2-r0,1.28.14-r34,0.70.0-r0,0.69.3-r10,0.30.1-r10,0.30.1-r8,3.94.3-r8,3.94.3-r6,0.11.0-r4,0.39.16-r1,0.10.8-r40,0.76.0-r1,0.75.1-r5,2.1.17-r1

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading