libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that… (CVE-2026-5917)
libgit2 versions v0.27.0 through v1.9.0 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 from the gen_proto() function in ssh_libssh2.c, which inserts the repository path directly into a shell command without escaping special characters before execution. An attacker can exploit this by crafting a malicious submodule URL in a .gitmodules file, causing command execution during a recursive clone under the victim's SSH user account.
AI Analysis
Technical Summary
The vulnerability in libgit2 (CVE-2026-5917) affects versions v0.27.0 through v1.9.0 when built with the libssh2 SSH backend (USE_SSH=libssh2). The gen_proto() function in ssh_libssh2.c constructs a shell command string that includes the repository path without escaping shell metacharacters such as single quotes, semicolons, or pipes. This allows an attacker to inject arbitrary shell commands on the SSH server by providing a malicious repository path, typically via a crafted submodule URL in a .gitmodules file. When a recursive clone processes this submodule, the injected commands execute under the victim's SSH user account. The vulnerability is classified as CWE-78 (Improper Neutralization of Special Elements used in an OS Command).
Potential Impact
Successful exploitation enables remote attackers to execute arbitrary commands on the SSH server with the privileges of the victim's SSH user account. This can lead to full compromise of the server, including confidentiality, integrity, and availability impacts. The CVSS v3.1 base score is 9.6 (critical), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, scope change, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid using libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend for operations involving untrusted repository paths or submodules. Consider disabling recursive cloning of submodules or sanitizing repository paths to prevent injection of shell metacharacters.
libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that… (CVE-2026-5917)
Description
libgit2 versions v0.27.0 through v1.9.0 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 from the gen_proto() function in ssh_libssh2.c, which inserts the repository path directly into a shell command without escaping special characters before execution. An attacker can exploit this by crafting a malicious submodule URL in a .gitmodules file, causing command execution during a recursive clone under the victim's SSH user account.
CVSS v3.1
Score 9.6critical
Affected software
pkg:github/libgit2/libgit2Run 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
The vulnerability in libgit2 (CVE-2026-5917) affects versions v0.27.0 through v1.9.0 when built with the libssh2 SSH backend (USE_SSH=libssh2). The gen_proto() function in ssh_libssh2.c constructs a shell command string that includes the repository path without escaping shell metacharacters such as single quotes, semicolons, or pipes. This allows an attacker to inject arbitrary shell commands on the SSH server by providing a malicious repository path, typically via a crafted submodule URL in a .gitmodules file. When a recursive clone processes this submodule, the injected commands execute under the victim's SSH user account. The vulnerability is classified as CWE-78 (Improper Neutralization of Special Elements used in an OS Command).
Potential Impact
Successful exploitation enables remote attackers to execute arbitrary commands on the SSH server with the privileges of the victim's SSH user account. This can lead to full compromise of the server, including confidentiality, integrity, and availability impacts. The CVSS v3.1 base score is 9.6 (critical), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, scope change, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid using libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend for operations involving untrusted repository paths or submodules. Consider disabling recursive cloning of submodules or sanitizing repository paths to prevent injection of shell metacharacters.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-3gwr-xcwq-7892
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-5917"]
- Ecosystems
- []
- Database Specific Severity
- CRITICAL
- Cvss Version
- 3.1
Threat ID: 6a7c9b6bbf8831d539cdfc11
Added to database: 08/12/2026, 16:12:27 UTC
Last enriched: 08/12/2026, 17:21:42 UTC
Last updated: 08/13/2026, 00:41:13 UTC
Views: 4
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.