Vulnerability · Published Aug 11, 2026 · Assigned by VulnCheck
CVE-2026-5917libgit2 Shell Command Injection via ssh_libssh2 Backend
High 8.8
In plain English
A high-severity OS command injection in libgit2 from libgit2. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.4% (higher than 73% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.23 | libgit2 | 1.9.7-r0 | ALPINE-CVE-2026-5917 |
| Alpine:v3.24 | libgit2 | 1.9.7-r0 | ALPINE-CVE-2026-5917 |
| Debian:12 | libgit2 | 1.5.1+ds-1+deb12u2 | DEBIAN-CVE-2026-5917 |
| Debian:13 | libgit2 | 1.9.0+ds-2+deb13u1 | DEBIAN-CVE-2026-5917 |
| Debian:14 | libgit2 | 1.9.7+ds-1 | DEBIAN-CVE-2026-5917 |
| Ubuntu:24.04:LTS | libgit2 | 1.7.2+ds-1ubuntu3.2 | USN-8809-1 |
| Ubuntu:24.04:LTS | libgit2 | 1.7.2+ds-1ubuntu3.2 | UBUNTU-CVE-2026-5917 |
| Ubuntu:26.04:LTS | libgit2 | 1.9.1+ds-1ubuntu1.2 | USN-8809-1 |
| Ubuntu:26.04:LTS | libgit2 | 1.9.1+ds-1ubuntu1.2 | UBUNTU-CVE-2026-5917 |
Affected products (as reported)
Weakness: CWE-78 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
References
- GitHub Security Advisory (GHSA-xqj4-2j5v-rr75) vendor-advisory, patch
- https://www.vulncheck.com/advisories/libgit2-shell-command-injection-via-ssh-libssh2-backend third-party-advisory