CVE-2026-5917
libgit2 Shell Command Injection via ssh_libssh2 Backend
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Active
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
8.6
libgit2 Shell Command Injection via ssh_libssh2 Backend
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.
- Record
CVE-2026-5917- CVSS 4.0
- 8.6 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-78
- Updated
- 2026-11-02
EUVDEUVD-2026-57011
8.6
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.
- Record
EUVD-2026-57011- CVSS 4.0
- 8.6 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-3gwr-xcwq-7892
9.4
libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend (USE_SSH=libssh2)...
libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.
- Record
GHSA-3gwr-xcwq-7892- CVSS 4.0
- 9.4 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/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 - CVSS 3.1
- 9.6 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H - Weakness
- CWE-78
- Updated
- 2026-11-02
NVD
8.6
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.
- Record
CVE-2026-5917- CVSS 4.0
- 8.6 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/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 - CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-78
- Updated
- 2026-11-02
OSVALPINE-CVE-2026-5917
8.8
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.
- Record
ALPINE-CVE-2026-5917- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-03
OSVBELL-CVE-2026-5917
8.8
- Record
BELL-CVE-2026-5917- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 10 moreShow less
OSV
8.6
libgit2 Shell Command Injection via ssh_libssh2 Backend
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.
- Record
CVE-2026-5917- CVSS 4.0
- 8.6 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-78
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-5917
8.8
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.
- Record
DEBIAN-CVE-2026-5917- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVJLSEC-2026-1275
9.4
libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend (USE_SSH=libssh2)...
libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.
- Record
JLSEC-2026-1275- CVSS 4.0
- 9.4 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/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 - CVSS 3.1
- 9.6 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H - Updated
- 2026-11-02
OSVOESA-2026-4621
8.6
libgit2 security update
libgit2 is a portable, pure C implementation of the Git core methods provided as a re-entrant linkable library with a solid API, allowing you to write native speed custom Git applications in any language which supports C bindings.
Security Fix(es):
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.(CVE-2026-5917)
- Record
OESA-2026-4621- CVSS 4.0
- 8.6 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/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 - Updated
- 2026-11-02
OSVOESA-2026-4622
8.6
libgit2 security update
libgit2 is a portable, pure C implementation of the Git core methods provided as a re-entrant linkable library with a solid API, allowing you to write native speed custom Git applications in any language which supports C bindings.
Security Fix(es):
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.(CVE-2026-5917)
- Record
OESA-2026-4622- CVSS 4.0
- 8.6 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/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 - Updated
- 2026-11-02
OSVOESA-2026-4623
8.6
libgit2 security update
libgit2 is a portable, pure C implementation of the Git core methods provided as a re-entrant linkable library with a solid API, allowing you to write native speed custom Git applications in any language which supports C bindings.
Security Fix(es):
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.(CVE-2026-5917)
- Record
OESA-2026-4623- CVSS 4.0
- 8.6 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/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 - Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-5917
8.6
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.
- Record
UBUNTU-CVE-2026-5917- CVSS 4.0
- 8.6 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVMGASA-2026-0570 No score
Updated libgit2 package fixes security vulnerabilities
Inverted IP SubjectAltName Comparison in OpenSSL Backend. (CVE-2026-53583) Submodule path traversal. (CVE-2026-53584) Unbounded Memory Allocation via Delta Object Result-Size Header. (CVE-2026-53585) HTTP transport can leak credentials to an offsite redirect target. (CVE-2026-53586) Unauthenticated network-reachable heap out-of-bounds read in transports/smart_pkt.c:set_data. (CVE-2026-53587) Shell Command Injection via ssh_libssh2 Backend. (CVE-2026-5917)
- Record
MGASA-2026-0570- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:11521-1 No score
libgit2-1_9-1.9.7-1.1 on GA media
These are all security issues fixed in the libgit2-1_9-1.9.7-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:11521-1- Updated
- 2026-11-02
OSVUSN-8809-1 No score
libgit2 vulnerability
Kazuma Matsumoto and Isabel Mill discovered that libgit2 incorrectly handled certain repository URLs when using the SSH transport. A remote attacker could possibly use this issue to execute arbitrary commands.
- Record
USN-8809-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
libgit2Alpine:v3.23 |
before 1.9.7-r0 | 1.9.7-r0 |
libgit2Alpine:v3.24 |
before 1.9.7-r0 | 1.9.7-r0 |
libgit2Alpaquita:25 |
1.9.0-r2 up to 1.9.7-r0 | 1.9.7-r0 |
libgit2Alpaquita:stream |
1.7.1-r0 up to 1.9.7-r0 | 1.9.7-r0 |
libgit2Debian:12 |
before 1.5.1+ds-1+deb12u2, plus listed versions 1.5.1+ds-11.5.1+ds-1+deb12u1 |
1.5.1+ds-1+deb12u2 |
libgit2Debian:13 |
before 1.9.0+ds-2+deb13u1, plus listed versions 1.9.0+ds-2 |
1.9.0+ds-2+deb13u1 |
libgit2Debian:14 |
before 1.9.7+ds-1, plus listed versions 1.9.0+ds-21.9.1+ds-11.9.2+ds-11.9.2+ds-21.9.2+ds-3 Show 9 moreShow less1.9.2+ds-41.9.2+ds-51.9.2+ds-61.9.2+ds-71.9.2+ds-81.9.2+ds-91.9.3+ds-11.9.4+ds-11.9.6+ds-1 |
1.9.7+ds-1 |
LibGit2_jllJulia |
before 1.9.1+0 | 1.9.1+0 |
libgit2Mageia:10 From an advisory covering 6 CVEs |
before 1.9.2-1.1.mga10 | 1.9.2-1.1.mga10 |
libgit2openEuler:24.03-LTS-SP1 |
before 1.7.2-3.oe2403sp1 | 1.7.2-3.oe2403sp1 |
Show 9 moreShow less
| Package | Affected | Fixed |
|---|---|---|
libgit2openEuler:24.03-LTS-SP3 |
before 1.7.2-3.oe2403sp3 | 1.7.2-3.oe2403sp3 |
libgit2openEuler:24.03-LTS-SP4 |
before 1.7.2-3.oe2403sp4 | 1.7.2-3.oe2403sp4 |
libgit2Ubuntu:Pro:16.04:LTS |
before 0.24.1-2ubuntu0.2+esm4, plus listed versions 0.22.2-20.23.1-10.24.1-20.24.1-2ubuntu0.20.24.1-2ubuntu0.2+esm10.24.1-2ubuntu0.2+esm20.24.1-2ubuntu0.2+esm3 |
0.24.1-2ubuntu0.2+esm4 |
libgit2Ubuntu:Pro:18.04:LTS |
before 0.26.0+dfsg.1-1.1ubuntu0.2+esm3, plus listed versions 0.25.1+really0.24.6-10.26.0+dfsg.1-1.10.26.0+dfsg.1-1.1build10.26.0+dfsg.1-1.1ubuntu0.20.26.0+dfsg.1-1.1ubuntu0.2+esm10.26.0+dfsg.1-1.1ubuntu0.2+esm2 |
0.26.0+dfsg.1-1.1ubuntu0.2+esm3 |
libgit2Ubuntu:Pro:20.04:LTS |
before 0.28.4+dfsg.1-2ubuntu0.1+esm2, plus listed versions 0.27.7+dfsg.1-0.2build10.28.3+dfsg.1-10.28.3+dfsg.1-1ubuntu10.28.4+dfsg.1-20.28.4+dfsg.1-2ubuntu0.10.28.4+dfsg.1-2ubuntu0.1+esm1 |
0.28.4+dfsg.1-2ubuntu0.1+esm2 |
libgit2Ubuntu:Pro:22.04:LTS |
before 1.1.0+dfsg.1-4.1ubuntu0.1+esm2, plus listed versions 1.1.0+dfsg.1-41.1.0+dfsg.1-4.11.1.0+dfsg.1-4.1build11.1.0+dfsg.1-4.1ubuntu0.11.1.0+dfsg.1-4.1ubuntu0.1+esm1 |
1.1.0+dfsg.1-4.1ubuntu0.1+esm2 |
libgit2Ubuntu:24.04:LTS |
before 1.7.2+ds-1ubuntu3.2, plus listed versions 1.5.1+ds-1ubuntu11.7.1+ds-2ubuntu11.7.2+ds-1ubuntu11.7.2+ds-1ubuntu21.7.2+ds-1ubuntu31.7.2+ds-1ubuntu3.1 |
1.7.2+ds-1ubuntu3.2 |
libgit2Ubuntu:26.04:LTS |
before 1.9.1+ds-1ubuntu1.2, plus listed versions 1.9.0+ds-2ubuntu21.9.1+ds-1ubuntu11.9.1+ds-1ubuntu1.1 |
1.9.1+ds-1ubuntu1.2 |
libgit2openSUSE:Tumbleweed |
before 1.9.7-1.1 | 1.9.7-1.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| affected, aliases, references | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-5917 is a high vulnerability (CVSS 8.6) in Libgit2, published August 11, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.43%, the 73rd percentile. Fixed in libgit2 1.9.7-r0.
References
github.com/libgit2/libgit2/security/advisories/GHSA-xqj4-2j5v-rr75
vulncheck.com/advisories/libgit2-shell-command-injection-via-ssh-libssh2-backend
nvd.nist.gov/vuln/detail/CVE-2026-5917
github.com/libgit2/libgit2
github.com/advisories/GHSA-3gwr-xcwq-7892
security.alpinelinux.org/vuln/CVE-2026-5917
Show 16 moreShow less
docs.bell-sw.com/security/cves/CVE-2026-5917
github.com/CVEProject/cvelistV5/tree/main/cves/2026/5xxx/CVE-2026-5917.json
security-tracker.debian.org/tracker/CVE-2026-5917
advisories.mageia.org/MGASA-2026-0570.html
bugs.mageia.org/show_bug.cgi?id=35993
lists.opensuse.org/archives/list/[email protected]/message/VHH635RSSSNGD55XOG7MSUBAC6CK77E2
openwall.com/lists/oss-security/2026/08/20/4
ubuntu.com/security/notices/USN-8628-1
lists.debian.org/debian-security-announce/2026/msg00364.html
openeuler.org/zh/security/security-bulletins/detail?id=openEuler-SA-2026-4621
openeuler.org/zh/security/security-bulletins/detail?id=openEuler-SA-2026-4622
openeuler.org/zh/security/security-bulletins/detail?id=openEuler-SA-2026-4623
ubuntu.com/security/CVE-2026-5917
cve.org/CVERecord?id=CVE-2026-5917
ubuntu.com/security/notices/USN-8809-1
suse.com/security/cve/CVE-2026-5917