CVE-2026-5917 libgit2 Shell Command Injection via ssh_libssh2 Backend

High 8.6 Published Updated

Remote attackers can execute arbitrary commands on SSH servers via malicious repository paths in libgit2 when using the libssh2 backend.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-5917?

CVE-2026-5917 is a high-severity command injection vulnerability in libgit2, published on 11 Aug 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

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.

Weakness: CWE-78

Which versions are affected by CVE-2026-5917?

Linux distribution packages (1)
libgit2 openSUSE:TumbleweedAll versions1.9.7-1.1

How do I fix CVE-2026-5917?

Upgrade to a fixed version.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2026-5917 being exploited?

There is no known exploitation of CVE-2026-5917 in the wild and no public exploit code.

Sources

Also known as BELL-CVE-2026-5917, DEBIAN-CVE-2026-5917, ECHO-25c0-43ef-f653, GHSA-3gwr-xcwq-7892, GHSA-xqj4-2j5v-rr75, JLSEC-2026-1275 and 6 more.

Is CVE-2026-5917 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free