{"id":"CVE-2026-5917","summary":"libgit2 Shell Command Injection via ssh_libssh2 Backend","details":"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.","aliases":["GHSA-xqj4-2j5v-rr75"],"modified":"2026-08-28T11:47:49.403371843Z","published":"2026-08-11T21:40:29.078Z","related":["openSUSE-SU-2026:11521-1"],"database_specific":{"cwe_ids":["CWE-78"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/5xxx/CVE-2026-5917.json","cna_assigner":"VulnCheck"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/5xxx/CVE-2026-5917.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-5917"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/libgit2-shell-command-injection-via-ssh-libssh2-backend"},{"type":"FIX","url":"https://github.com/libgit2/libgit2/security/advisories/GHSA-xqj4-2j5v-rr75"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/libgit2/libgit2","events":[{"introduced":"0"},{"fixed":"fa864d0bc86ed672ff9444135ab33477e545f790"},{"introduced":"338e6fb681369ff0537719095e22ce9dc602dbf0"},{"fixed":"49e408b3208bc3093757a1c2db938d3590f3f412"}],"database_specific":{"source":"AFFECTED_FIELD","extracted_events":[{"introduced":"0"},{"fixed":"1.8.7"},{"introduced":"1.9.0"},{"fixed":"1.9.7"}]}}],"versions":["v1.9.6","v1.8.6","v1.9.5","v1.8.5","v1.9.4","v1.9.3","v1.9.2","v1.9.1","v1.8.4","v1.9.0","v1.8.3","v1.8.1","v1.8.0","v1.7.0","v1.6.3","v1.6.2","v1.6.1","v1.5.0","v1.3.0","v1.4.0","v1.2.0","v1.1.0","v1.0.0","v0.99.0","v0.28.0-rc1","v0.28.0","v0.27.0","v0.27.0-rc3","v0.26.0-rc2","v0.26.0","v0.27.0-rc1","v0.27.0-rc2","v0.26.0-rc1","v0.24.0","v0.24.0-rc1","v0.23.0","v0.23.0-rc2","v0.23.0-rc1","v0.22.0","v0.22.0-rc2","v0.22.0-rc1","v0.21.0","v0.18.0","v0.17.0","v0.16.0","v0.15.0","v0.14.0","v0.13.0","v0.12.0","v0.11.0","v0.10.0","v0.8.0","v0.3.0","v0.2.0","v0.1.0"],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-5917.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"}]}