{"id":"CVE-2026-5917","revision":"0dd58bbce0cb439cbea47cc8a70d3617","records":[{"revision":"0dd58bbce0cb439cbea47cc8a70d3617","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-5917","aliases":[],"title":"libgit2 Shell Command Injection via ssh_libssh2 Backend","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.","state":0,"publishedAt":"2026-08-11T21:40:29.078+00:00","modifiedAt":"2026-10-01T15:20:07.878+00:00","affected":[{"ecosystem":"Vendor product","name":"libgit2","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"defaultStatus\": \"affected\",\n                    \"vendor\": \"libgit2\",\n                    \"product\": \"libgit2\",\n                    \"versions\": [\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"0\",\n                            \"versionType\": \"custom\",\n                            \"lessThan\": \"1.8.7\"\n                        },\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"1.9.0\",\n                            \"versionType\": \"semver\",\n                            \"lessThan\": \"1.9.7\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","vector":"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","score":8.6,"severity":"HIGH"},{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"severity":"HIGH"}],"references":["https://github.com/libgit2/libgit2/security/advisories/GHSA-xqj4-2j5v-rr75","https://www.vulncheck.com/advisories/libgit2-shell-command-injection-via-ssh-libssh2-backend"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-5917","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-5917","identifiers":["CVE-2026-5917"]},"retained":false,"historicalAffected":[]}],"coverage":[]}