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.

Severity (CVSS 3.1)8.8High
Exploit odds (30 days)1.4%top 26.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Alpine:v3.23libgit21.9.7-r0ALPINE-CVE-2026-5917
Alpine:v3.24libgit21.9.7-r0ALPINE-CVE-2026-5917
Debian:12libgit21.5.1+ds-1+deb12u2DEBIAN-CVE-2026-5917
Debian:13libgit21.9.0+ds-2+deb13u1DEBIAN-CVE-2026-5917
Debian:14libgit21.9.7+ds-1DEBIAN-CVE-2026-5917
Ubuntu:24.04:LTSlibgit21.7.2+ds-1ubuntu3.2USN-8809-1
Ubuntu:24.04:LTSlibgit21.7.2+ds-1ubuntu3.2UBUNTU-CVE-2026-5917
Ubuntu:26.04:LTSlibgit21.9.1+ds-1ubuntu1.2USN-8809-1
Ubuntu:26.04:LTSlibgit21.9.1+ds-1ubuntu1.2UBUNTU-CVE-2026-5917

Affected products (as reported)

VendorProductVersions
libgit2 libgit2 0 – before 1.8.71.9.0 – before 1.9.7

Weakness: CWE-78 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

References