CVEfocus › CVE database › CVE-2026-5917

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

CVSS 8.8 HighEPSS 1.4% (higher than 73% of CVEs)Published 2026-08-11Updated 2026-10-01Assigner: VulnCheck

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.

CWE-78

What to do

Fixed builds are available from Alpine, Debian, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

7Fixed
4Fix pending
35Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04libgit2Fixed1.9.1+ds-1ubuntu1.2UBUNTU-CVE-2026-5917
Ubuntu 24.04libgit2Fixed1.7.2+ds-1ubuntu3.2UBUNTU-CVE-2026-5917
Ubuntu 22.04libgit2Fix pending1.1.0+dfsg.1-4.1ubuntu0.1+esm2 (Ubuntu Pro)UBUNTU-CVE-2026-5917
Ubuntu 20.04libgit2Fix pending0.28.4+dfsg.1-2ubuntu0.1+esm2 (Ubuntu Pro)UBUNTU-CVE-2026-5917
Ubuntu 18.04libgit2Fix pending0.26.0+dfsg.1-1.1ubuntu0.2+esm3 (Ubuntu Pro)UBUNTU-CVE-2026-5917
Ubuntu 16.04libgit2Fix pending0.24.1-2ubuntu0.2+esm4 (Ubuntu Pro)UBUNTU-CVE-2026-5917
Debian 14libgit2Fixed1.9.7+ds-1DEBIAN-CVE-2026-5917
Debian 13libgit2Fixed1.9.0+ds-2+deb13u1DEBIAN-CVE-2026-5917
Debian 12libgit2Fixed1.5.1+ds-1+deb12u2DEBIAN-CVE-2026-5917
Red Hat Enterprise Linux 10cargoNot affected
Red Hat Enterprise Linux 10clippyNot affected
Red Hat Enterprise Linux 10rustNot affected
Red Hat Enterprise Linux 10rust-analyzerNot affected
Red Hat Enterprise Linux 10rust-debugger-commonNot affected
Red Hat Enterprise Linux 10rust-docNot affected
Red Hat Enterprise Linux 10rust-gdbNot affected
Red Hat Enterprise Linux 10rust-lldbNot affected
Red Hat Enterprise Linux 10rust-srcNot affected
Red Hat Enterprise Linux 10rust-std-staticNot affected
Red Hat Enterprise Linux 10rust-std-static-aarch64-unknown-none-softfloatNot affected
Red Hat Enterprise Linux 10rust-std-static-wasm32-unknown-unknownNot affected
Red Hat Enterprise Linux 10rust-std-static-wasm32-wasip1Not affected
Red Hat Enterprise Linux 10rust-std-static-x86_64-unknown-noneNot affected
Red Hat Enterprise Linux 10rust-toolsetNot affected
Red Hat Enterprise Linux 10rust-toolset-srpm-macrosNot affected
Red Hat Enterprise Linux 10rustfmtNot affected
Red Hat Enterprise Linux 9cargoNot affected
Red Hat Enterprise Linux 9clippyNot affected
Red Hat Enterprise Linux 9rustNot affected
Red Hat Enterprise Linux 9rust-analysisNot affected
Red Hat Enterprise Linux 9rust-analyzerNot affected
Red Hat Enterprise Linux 9rust-debugger-commonNot affected
Red Hat Enterprise Linux 9rust-docNot affected
Red Hat Enterprise Linux 9rust-gdbNot affected
Red Hat Enterprise Linux 9rust-lldbNot affected
Red Hat Enterprise Linux 9rust-srcNot affected
Red Hat Enterprise Linux 9rust-std-staticNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-unknown-unknownNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-wasiNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-wasip1Not affected
Red Hat Enterprise Linux 9rust-toolsetNot affected
Red Hat Enterprise Linux 9rustfmtNot affected
Red Hat Enterprise Linux 8libgit2Not affected
Red Hat Enterprise Linux 8libgit2-develNot affected
Alpine Linux 3.24libgit2Fixed1.9.7-r0ALPINE-CVE-2026-5917
Alpine Linux 3.23libgit2Fixed1.9.7-r0ALPINE-CVE-2026-5917

What the vendor says

As published in the CVE record by VulnCheck, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.