Every CVE Search/ Get API key

CVE-2026-5917

libgit2 Shell Command Injection via ssh_libssh2 Backend

8.6 HighFix available

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

1.43%Up 0.6 points since Aug 12, 2026
90%50%10%1%

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 HighCVSS: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 HighCVSS: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 HighCVSS: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 CriticalCVSS: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 CriticalCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 CriticalCVSS: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 CriticalCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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

Affected packages
PackageAffectedFixed
libgit2
Alpine:v3.23
before 1.9.7-r0
1.9.7-r0
libgit2
Alpine:v3.24
before 1.9.7-r0
1.9.7-r0
libgit2
Alpaquita:25
1.9.0-r2 up to 1.9.7-r0
1.9.7-r0
libgit2
Alpaquita:stream
1.7.1-r0 up to 1.9.7-r0
1.9.7-r0
libgit2
Debian: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
libgit2
Debian:13
before 1.9.0+ds-2+deb13u1, plus listed versions
1.9.0+ds-2
1.9.0+ds-2+deb13u1
libgit2
Debian: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 less
1.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_jll
Julia
before 1.9.1+0
1.9.1+0
libgit2
Mageia:10
From an advisory covering 6 CVEs
before 1.9.2-1.1.mga10
1.9.2-1.1.mga10
libgit2
openEuler:24.03-LTS-SP1
before 1.7.2-3.oe2403sp1
1.7.2-3.oe2403sp1
Show 9 moreShow less
Affected packages
PackageAffectedFixed
libgit2
openEuler:24.03-LTS-SP3
before 1.7.2-3.oe2403sp3
1.7.2-3.oe2403sp3
libgit2
openEuler:24.03-LTS-SP4
before 1.7.2-3.oe2403sp4
1.7.2-3.oe2403sp4
libgit2
Ubuntu: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
libgit2
Ubuntu: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
libgit2
Ubuntu: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
libgit2
Ubuntu: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
libgit2
Ubuntu: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
libgit2
Ubuntu: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
libgit2
openSUSE:Tumbleweed
before 1.9.7-1.1
1.9.7-1.1

History

History
RecordedChangedSources
affected, facts
affected, aliases, referencesOSV
first indexedCVE 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

Show 16 moreShow less
MoveEnter Open