CVE-2026-45570
ADVISORY - githubSummary
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 sq_quote_buf 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 $SSH_ORIGINAL_COMMAND), 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 sq_quote_buf 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:
Common Weakness Enumeration (CWE)
Improper Encoding or Escaping of Output
Improper Encoding or Escaping of Output
GitHub
-
CVSS SCORE
2.3low| Package | Type | OS Name | OS Version | Affected Ranges | Fix Versions |
|---|---|---|---|---|---|
| github.com/go-git/go-git/v5 | golang | - | - | <=5.19.0 | 5.19.1 |
| github.com/go-git/go-git | golang | - | - | <=4.7.0 | Not yet available |
| github.com/go-git/go-git/v5 | golang | - | - | <0.0.0-20260518201055-3c3be601aa6c | 0.0.0-20260518201055-3c3be601aa6c |
| github.com/go-git/go-git/v6 | golang | - | - | <=6.0.0-alpha.3 | 6.0.0-alpha.4 |
| github.com/go-git/go-git/v6 | golang | - | - | <0.0.0-20260518135925-d9a698310823 | 0.0.0-20260518135925-d9a698310823 |
CVSS:4 Severity and metrics
The CVSS metrics represent different qualitative aspects of a vulnerability that impact the overall score, as defined by the CVSS Specification.
The vulnerable component is bound to the network stack, but the attack is limited at the protocol level to a logically adjacent topology. This can mean an attack must be launched from the same shared physical (e.g., Bluetooth or IEEE 802.11) or logical (e.g., local IP subnet) network, or from within a secure or otherwise limited administrative domain (e.g., MPLS, secure VPN to an administrative network zone). One example of an Adjacent attack would be an ARP (IPv4) or neighbor discovery (IPv6) flood leading to a denial of service on the local LAN segment (e.g., CVE-2013-6014).
Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success when attacking the vulnerable component.
The successful attack depends on the presence of specific deployment and execution conditions of the vulnerable system that enable the attack. These include: A race condition must be won to successfully exploit the vulnerability. The successfulness of the attack is conditioned on execution conditions that are not under full control of the attacker. The attack may need to be launched multiple times against a single target before being successful. Network injection. The attacker must inject themselves into the logical network path between the target and the resource requested by the victim (e.g. vulnerabilities requiring an on-path attacker).
The attacker is unauthenticated prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack.
Successful exploitation of this vulnerability requires limited interaction by the targeted user with the vulnerable system and the attacker's payload. These interactions would be considered involuntary and do not require that the user actively subvert protections built into the vulnerable system. Examples include: utilizing a website that has been modified to display malicious content when the page is rendered (most stored XSS or CSRF) running an application that calls a malicious binary that has been planted on the system using an application which generates traffic over an untrusted or compromised network (vulnerabilities requiring an on-path attacker).
There is no loss of confidentiality within the Vulnerable System.
There is some loss of confidentiality. Access to some restricted information is obtained, but the attacker does not have control over what information is obtained, or the amount or kind of loss is limited. The information disclosure does not cause a direct, serious loss to the Subsequent System.
There is no loss of integrity within the Vulnerable System.
Modification of data is possible, but the attacker does not have control over the consequence of a modification, or the amount of modification is limited. The data modification does not have a direct, serious impact to the Subsequent System.
There is no impact to availability within the Vulnerable System.
Performance is reduced or there are interruptions in resource availability. Even if repeated exploitation of the vulnerability is possible, the attacker does not have the ability to completely deny service to legitimate users. The resources in the Subsequent System are either partially available all of the time, or fully available only some of the time, but overall there is no direct, serious consequence to the Subsequent System.
NIST
2.8
CVSS SCORE
2.3lowDebian
-
Ubuntu
2.8
CVSS SCORE
9.6mediumGoLang
-
Chainguard
CGA-4fx8-v7vx-v65m
-
minimos
MINI-24hr-44fm-q245
-
minimos
MINI-27mm-rr94-fw8w
-
minimos
MINI-2hwr-67cp-gpf5
-
minimos
MINI-2vmw-5w4p-xc22
-
minimos
MINI-2xm9-cvvq-5qpw
-
minimos
MINI-2xp7-vg68-3q4m
-
minimos
MINI-3235-hw4r-7jw6
-
minimos
MINI-37ph-w3mc-ghw7
-
minimos
MINI-3c9f-6qfc-rv55
-
minimos
MINI-3g2p-99xg-v49x
-
minimos
MINI-3jvm-7rh5-h99c
-
minimos
MINI-3q9j-hfr3-xj85
-
minimos
MINI-47f6-gwq4-frmx
-
minimos
MINI-4pqh-26qj-x2x4
-
minimos
MINI-4rc2-rw98-g7g7
-
minimos
MINI-4xm6-82wp-xrfm
-
minimos
MINI-5223-fhg3-29q3
-
minimos
MINI-54c5-jgxw-wgv4
-
minimos
MINI-556w-fwqq-24f9
-
minimos
MINI-55j5-pvc3-hfmw
-
minimos
MINI-56j6-439x-j2g7
-
minimos
MINI-57g9-gchg-5jcc
-
minimos
MINI-57q8-g4vv-7wxr
-
minimos
MINI-5cr7-8888-2v2f
-
minimos
MINI-5cxq-3669-w598
-
minimos
MINI-5g5j-prwm-gfcj
-
minimos
MINI-5hrq-mxj6-45pq
-
minimos
MINI-5jf7-vw4x-5x77
-
minimos
MINI-5p23-283j-v285
-
minimos
MINI-5pfc-3xvm-2xrc
-
minimos
MINI-5whr-6wf4-v4mp
-
minimos
MINI-5whx-h2rc-9pfr
-
minimos
MINI-64q2-x6p8-9588
-
minimos
MINI-66p3-r43x-35jx
-
minimos
MINI-6fgr-4qp8-6hf4
-
minimos
MINI-6fp2-56rg-2qj7
-
minimos
MINI-6jpm-q6fw-qmxc
-
minimos
MINI-6vm6-hvr8-rm6r
-
minimos
MINI-739v-mgww-9g8x
-
minimos
MINI-7539-9799-rhv7
-
minimos
MINI-75fv-63h2-hwxh
-
minimos
MINI-76ch-2w8c-xf2m
-
minimos
MINI-76xj-54qp-vj33
-
minimos
MINI-77mp-6gvw-vw9g
-
minimos
MINI-7c8x-gc3g-whpv
-
minimos
MINI-7ffv-qx98-ggpj
-
minimos
MINI-7hj8-299f-g6h6
-
minimos
MINI-87gq-4wg4-v56w
-
minimos
MINI-892j-rh7g-9fcc
-
minimos
MINI-8c88-97g8-q8cq
-
minimos
MINI-8jmj-86gc-gv3v
-
minimos
MINI-8p2g-6x56-3rj6
-
minimos
MINI-8p2w-m2qm-6prw
-
minimos
MINI-8phx-qvpf-f84c
-
minimos
MINI-8w7p-cmh8-9hw2
-
minimos
MINI-9396-wxx2-jgvx
-
minimos
MINI-93h4-78g6-9pqx
-
minimos
MINI-9423-mv8m-8vpp
-
minimos
MINI-96mx-4g23-r972
-
minimos
MINI-9rff-xrxq-xgf5
-
minimos
MINI-9v3h-vpx2-5p5r
-
minimos
MINI-9v5g-qvrp-wjph
-
minimos
MINI-9w2r-2pm7-jvpv
-
minimos
MINI-9wf4-j2f5-8mr3
-
minimos
MINI-c64v-r5vm-vphp
-
minimos
MINI-c7v8-hhxv-8cmf
-
minimos
MINI-c8p3-rwr7-c2q7
-
minimos
MINI-c938-r492-g5g6
-
minimos
MINI-cc7c-m4rw-5v28
-
minimos
MINI-cfg9-m8q9-j7rq
-
minimos
MINI-cq3g-5g3m-3qg9
-
minimos
MINI-cqcg-3rf9-fcmj
-
minimos
MINI-cxq3-mmc2-xpxx
-
minimos
MINI-f69q-3v84-xq6h
-
minimos
MINI-f6xp-6pf4-h5cx
-
minimos
MINI-f758-v38q-qmm5
-
minimos
MINI-fcrm-635h-5m5x
-
minimos
MINI-fg9x-9gv4-r42r
-
minimos
MINI-fghq-cxwh-55f9
-
minimos
MINI-fm2r-mxhh-x63q
-
minimos
MINI-fq76-4wwp-vfrp
-
minimos
MINI-fqgg-x294-f74j
-
minimos
MINI-frxp-vv24-2m65
-
minimos
MINI-fv9r-39r3-vxxr
-
minimos
MINI-fw3g-387r-6824
-
minimos
MINI-g22j-3p83-hwrr
-
minimos
MINI-g5m6-gmf3-gw3v
-
minimos
MINI-g5q5-xpm6-vcq9
-
minimos
MINI-g983-w2jj-fc57
-
minimos
MINI-gc5c-v9mx-m5vm
-
minimos
MINI-gf4g-588f-5mfc
-
minimos
MINI-gj9r-4w9p-f368
-
minimos
MINI-gr5g-h3wx-ghfj
-
minimos
MINI-gv68-fccm-p2mc
-
minimos
MINI-gvxc-cm38-4mvv
-
minimos
MINI-h2mw-pv59-j438
-
minimos
MINI-h5vw-v7p4-54wj
-
minimos
MINI-hcfc-mg2q-p824
-
minimos
MINI-hg22-8cpv-jqx2
-
minimos
MINI-hq6r-w5w4-ggpq
-
minimos
MINI-hr5h-p6x7-rfrf
-
minimos
MINI-hvjp-x4m7-fgp3
-
minimos
MINI-hvvg-x9wc-9m3v
-
minimos
MINI-j2qm-92xv-w8j2
-
minimos
MINI-j438-gjcg-ppwr
-
minimos
MINI-jgmm-w4h8-4vwh
-
minimos
MINI-jhrc-7pmv-49c7
-
minimos
MINI-jjfx-92h9-qf7c
-
minimos
MINI-jjwp-j23c-rmjx
-
minimos
MINI-jwf3-vv6x-7cmx
-
minimos
MINI-jxv6-pmf7-v585
-
minimos
MINI-m3rp-mxc2-jx26
-
minimos
MINI-m888-mgrh-mg22
-
minimos
MINI-m92w-wf7w-6j9p
-
minimos
MINI-m9c7-w6cf-rrh4
-
minimos
MINI-mg8x-mv8v-j3jf
-
minimos
MINI-mh5w-rgcj-phjf
-
minimos
MINI-mhxm-j472-pqv5
-
minimos
MINI-mw7f-9q3m-j7px
-
minimos
MINI-p273-j587-99pq
-
minimos
MINI-p3fw-9w7v-cr2j
-
minimos
MINI-p5cv-vvp8-fjwg
-
minimos
MINI-p6pw-4fc8-m578
-
minimos
MINI-p948-p556-wjp4
-
minimos
MINI-p9cm-4r3j-wrm2
-
minimos
MINI-p9mx-j3qh-xqcp
-
minimos
MINI-pg44-9whw-389f
-
minimos
MINI-pgq6-q3j2-8r34
-
minimos
MINI-pq5c-584f-9c6r
-
minimos
MINI-prg8-vwwh-jph6
-
minimos
MINI-pw2f-2qc7-r8jw
-
minimos
MINI-px5x-pjg6-jv5q
-
minimos
MINI-q84x-5mxh-3vj2
-
minimos
MINI-q8gm-j527-374c
-
minimos
MINI-q99w-f2pj-33j7
-
minimos
MINI-q9jg-hv24-g64v
-
minimos
MINI-qqc7-pj8x-fxqc
-
minimos
MINI-qvqf-8c7c-4vc4
-
minimos
MINI-qw33-jfhj-2jc4
-
minimos
MINI-r338-6478-3rm5
-
minimos
MINI-r35r-g33x-922p
-
minimos
MINI-rc8c-45vf-fh4q
-
minimos
MINI-rgpq-ccw3-wjh2
-
minimos
MINI-rgrm-ccm2-cv6q
-
minimos
MINI-rhm4-wmmm-8rg4
-
minimos
MINI-rq4q-vhg7-52cp
-
minimos
MINI-v3fg-gcm2-pc9r
-
minimos
MINI-v8m2-v5c3-3x6x
-
minimos
MINI-v97q-rfww-q5p9
-
minimos
MINI-vjwq-g67j-jjc2
-
minimos
MINI-vmq9-ccjf-wgx6
-
minimos
MINI-vrg4-rmrx-g9xc
-
minimos
MINI-vrx6-w88f-j45g
-
minimos
MINI-vxpx-wh88-7hpr
-
minimos
MINI-w6g2-jcmw-qqv3
-
minimos
MINI-w9j5-pm7f-48mq
-
minimos
MINI-wcw3-6jcw-44hv
-
minimos
MINI-wfr8-5jc3-q8v7
-
minimos
MINI-wjq8-f252-qf89
-
minimos
MINI-wmw5-6rvq-9p9j
-
minimos
MINI-wp36-55gq-8qv7
-
minimos
MINI-wpp8-wfg9-7fv4
-
minimos
MINI-x57m-54r9-6465
-
minimos
MINI-x96c-f8wm-6hf3
-
minimos
MINI-xcvq-x57m-3fv6
-
minimos
MINI-xf63-5p4r-586p
-
minimos
MINI-xg98-mf38-369w
-
minimos
MINI-xgq3-qx6j-7w4w
-
minimos
MINI-xgwf-55c3-hp4h
-
minimos
MINI-xhf7-4vmg-hg5h
-
minimos
MINI-xm34-5hp2-5f37
-
minimos
MINI-xm9x-vgp6-8987
-
minimos
MINI-xmh2-jx58-h33q
-
minimos
MINI-xp2c-hhp4-rv7c
-
minimos
MINI-xw8w-j227-mv79
-