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… (CVE-2026-5917)
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend contain a shell command injection vulnerability. This flaw allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path with unescaped shell metacharacters. The vulnerability arises because the repository path is inserted directly into a shell command without proper escaping, enabling command injection during recursive clone operations involving malicious submodule URLs.
AI Analysis
Technical Summary
CVE-2026-5917 affects libgit2 versions prior to 1.8.7 and 1.9.0 prior to 1.9.7 when built with the libssh2 SSH backend (USE_SSH=libssh2). The vulnerability is a shell command injection in the gen_proto() function within ssh_libssh2.c, where the repository path is embedded directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(). An attacker can craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote SSH server's shell to execute arbitrary commands under the victim's SSH user account.
Potential Impact
Successful exploitation allows remote attackers to execute arbitrary shell commands on the SSH server under the victim's SSH user account. This can lead to full compromise of the server's privileges accessible to that user, including data theft, system manipulation, or further lateral movement. The CVSS 3.1 score is 8.8, indicating a high severity impact with network attack vector, low attack complexity, no privileges required, user interaction required, and high confidentiality, integrity, and availability impacts.
Mitigation Recommendations
A fix is available in libgit2 versions 1.8.7 and 1.9.7 and later. Users should upgrade to these or newer versions to remediate this vulnerability. Until patched, avoid using vulnerable versions built with the libssh2 SSH backend or do not process untrusted repository paths containing shell metacharacters. No vendor advisory content was provided to indicate alternative mitigations or that the issue is already mitigated.
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… (CVE-2026-5917)
Description
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend contain a shell command injection vulnerability. This flaw allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path with unescaped shell metacharacters. The vulnerability arises because the repository path is inserted directly into a shell command without proper escaping, enabling command injection during recursive clone operations involving malicious submodule URLs.
CVSS v3.1
Score 8.8high
Affected software
pkg:github/libgit2/libgit2pkg:deb/ubuntu/libgit2?arch=source&distro=esm-apps-legacy/xenialpkg:deb/ubuntu/libgit2?arch=source&distro=esm-apps/bionicpkg:deb/ubuntu/libgit2?arch=source&distro=esm-apps/focalpkg:deb/ubuntu/libgit2?arch=source&distro=esm-apps/jammypkg:deb/ubuntu/libgit2?arch=source&distro=noblepkg:deb/ubuntu/libgit2?arch=source&distro=resoluteRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-5917 affects libgit2 versions prior to 1.8.7 and 1.9.0 prior to 1.9.7 when built with the libssh2 SSH backend (USE_SSH=libssh2). The vulnerability is a shell command injection in the gen_proto() function within ssh_libssh2.c, where the repository path is embedded directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(). An attacker can craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote SSH server's shell to execute arbitrary commands under the victim's SSH user account.
Potential Impact
Successful exploitation allows remote attackers to execute arbitrary shell commands on the SSH server under the victim's SSH user account. This can lead to full compromise of the server's privileges accessible to that user, including data theft, system manipulation, or further lateral movement. The CVSS 3.1 score is 8.8, indicating a high severity impact with network attack vector, low attack complexity, no privileges required, user interaction required, and high confidentiality, integrity, and availability impacts.
Mitigation Recommendations
A fix is available in libgit2 versions 1.8.7 and 1.9.7 and later. Users should upgrade to these or newer versions to remediate this vulnerability. Until patched, avoid using vulnerable versions built with the libssh2 SSH backend or do not process untrusted repository paths containing shell metacharacters. No vendor advisory content was provided to indicate alternative mitigations or that the issue is already mitigated.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-3gwr-xcwq-7892
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-5917"]
- Database Specific Severity
- CRITICAL
- Cvss Version
- 3.1
Threat ID: 6a7c9b6bbf8831d539cdfc11
Added to database: 08/12/2026, 16:12:27 UTC
Last enriched: 09/24/2026, 08:28:17 UTC
Last updated: 09/25/2026, 01:47:43 UTC
Views: 26
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.